File tree Expand file tree Collapse file tree 2 files changed +22
-17
lines changed
apps/playground-web/src/components Expand file tree Collapse file tree 2 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 33import { MoonIcon , SunIcon } from "lucide-react" ;
44import { useTheme } from "next-themes" ;
55import { ClientOnly } from "@/components/ClientOnly" ;
6- import { Button } from "@/components/ui/button" ;
6+ import {
7+ SidebarMenu ,
8+ SidebarMenuButton ,
9+ SidebarMenuItem ,
10+ } from "@/components/ui/sidebar" ;
711import { Skeleton } from "@/components/ui/skeleton" ;
812
913export function ThemeToggle ( ) {
1014 const { setTheme, theme } = useTheme ( ) ;
1115
1216 return (
13- < div className = "border-t pt-2" >
14- < ClientOnly
15- ssr = { < Skeleton className = "size-[34px] rounded-full border bg-accent" /> }
16- >
17- < Button
17+ < SidebarMenu >
18+ < SidebarMenuItem >
19+ < SidebarMenuButton
1820 aria-label = "Toggle theme"
1921 className = "w-full text-muted-foreground hover:text-foreground px-2 py-1.5 text-left justify-start gap-2 capitalize h-auto font-normal"
2022 onClick = { ( ) => {
2123 setTheme ( theme === "dark" ? "light" : "dark" ) ;
2224 } }
23- size = "sm"
24- variant = "ghost"
2525 >
26- { theme === "light" ? (
27- < SunIcon className = "size-4" />
28- ) : (
29- < MoonIcon className = "size-4" />
30- ) }
26+ < ClientOnly ssr = { < Skeleton className = "size-4" /> } >
27+ { theme === "light" ? (
28+ < SunIcon className = "size-4" />
29+ ) : (
30+ < MoonIcon className = "size-4" />
31+ ) }
32+ </ ClientOnly >
3133
32- { theme }
33- </ Button >
34- </ ClientOnly >
35- </ div >
34+ < ClientOnly ssr = { < Skeleton className = "w-16 h-4" /> } >
35+ < span > { theme } </ span >
36+ </ ClientOnly >
37+ </ SidebarMenuButton >
38+ </ SidebarMenuItem >
39+ </ SidebarMenu >
3640 ) ;
3741}
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ function FullWidthSidebarLayoutInner(props: FullWidthSidebarLayoutProps) {
126126 links = { footerSidebarLinks }
127127 fullPath = { props . fullPath }
128128 />
129+ < SidebarSeparator />
129130 < ThemeToggle />
130131 </ SidebarFooter >
131132 ) }
You can’t perform that action at this time.
0 commit comments