-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
424 additions
and
48 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import { MoonIcon, SunIcon } from '@radix-ui/react-icons'; | ||
import { useTheme } from 'next-themes'; | ||
|
||
import { Button } from '~/components/ui/button'; | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuTrigger, | ||
} from '~/components/ui/dropdown-menu'; | ||
|
||
export function ModeToggle() { | ||
const { setTheme } = useTheme(); | ||
|
||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button | ||
variant="outline" | ||
size="icon" | ||
className="border-primary-900 bg-primary-200 dark:border-primary-200 dark:bg-primary-900" | ||
> | ||
<SunIcon className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" /> | ||
<MoonIcon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" /> | ||
<span className="sr-only">Toggle theme</span> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent | ||
align="end" | ||
className="bg-white text-primary-900 dark:border dark:border-primary-400 dark:bg-primary-900 dark:text-white" | ||
> | ||
<DropdownMenuItem | ||
className="cursor-pointer hover:bg-primary-200 dark:hover:bg-gray-200/20" | ||
onClick={() => setTheme('light')} | ||
> | ||
Light | ||
</DropdownMenuItem> | ||
<DropdownMenuItem | ||
className="cursor-pointer hover:bg-primary-200 dark:hover:bg-gray-200/20" | ||
onClick={() => setTheme('dark')} | ||
> | ||
Dark | ||
</DropdownMenuItem> | ||
<DropdownMenuItem | ||
className="cursor-pointer hover:bg-primary-200 dark:hover:bg-gray-200/20" | ||
onClick={() => setTheme('system')} | ||
> | ||
System | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import { ThemeProvider as NextThemesProvider } from 'next-themes'; | ||
import { type ThemeProviderProps } from 'next-themes/dist/types'; | ||
|
||
export function ThemeProvider({ children, ...props }: ThemeProviderProps) { | ||
return <NextThemesProvider {...props}>{children}</NextThemesProvider>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.