File tree Expand file tree Collapse file tree 3 files changed +34
-11
lines changed
Expand file tree Collapse file tree 3 files changed +34
-11
lines changed Original file line number Diff line number Diff line change 1- import { Moon , Sun } from 'lucide-react' ;
1+ import { cn } from '@/lib/utils' ;
2+ import { Monitor , Moon , Sun } from 'lucide-react' ;
23import { useTheme } from '@/components/themeProvider' ;
34import { Button } from '@/components/ui/button' ;
45
56export function ModeToggle ( ) {
6- const { setTheme } = useTheme ( ) ;
7+ const { theme , setTheme } = useTheme ( ) ;
78
89 return (
9- < div >
10- < Button onClick = { ( ) => setTheme ( 'light' ) } >
10+ < div className = "rounded-full border p-1" >
11+ < Button
12+ variant = { 'link' }
13+ size = { 'none' }
14+ className = { cn (
15+ 'text-foreground hover:bg-muted border p-1' ,
16+ theme === 'dark' ? 'border' : 'border-transparent'
17+ ) }
18+ onClick = { ( ) => setTheme ( 'dark' ) }
19+ >
1120 < Moon />
12- Light
1321 </ Button >
14- < Button onClick = { ( ) => setTheme ( 'dark' ) } >
22+ < Button
23+ variant = { 'link' }
24+ size = { 'none' }
25+ className = { cn (
26+ 'text-foreground hover:bg-muted border p-1' ,
27+ theme === 'light' ? 'border' : 'border-transparent'
28+ ) }
29+ onClick = { ( ) => setTheme ( 'light' ) }
30+ >
1531 < Sun />
16- Dark
1732 </ Button >
18- < Button onClick = { ( ) => setTheme ( 'system' ) } >
19- < Sun />
20- System
33+ < Button
34+ variant = { 'link' }
35+ size = { 'none' }
36+ className = { cn (
37+ 'text-foreground hover:bg-muted border p-1' ,
38+ theme === 'system' ? 'border' : 'border-transparent'
39+ ) }
40+ onClick = { ( ) => setTheme ( 'system' ) }
41+ >
42+ < Monitor />
2143 </ Button >
2244 </ div >
2345 ) ;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export function Navbar() {
3232 < span className = "border-secondary border-l" />
3333 </ div >
3434 ) }
35- < div className = "content hidden md:flex" >
35+ < div className = "content hidden gap-4 md:flex" >
3636 < ModeToggle />
3737 < ChainSelector />
3838 </ div >
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ const buttonVariants = cva(
2929 default : 'h-9 px-4 py-2 has-[>svg]:px-3 rounded-full' ,
3030 lg : 'h-11 rounded-full px-6 has-[>svg]:px-4 text-md' ,
3131 icon : 'size-9 rounded-md' ,
32+ none : 'p-0 rounded-full' ,
3233 } ,
3334 } ,
3435 defaultVariants : {
You can’t perform that action at this time.
0 commit comments