diff options
Diffstat (limited to 'apps/web/app/components/theme-button.tsx')
| -rw-r--r-- | apps/web/app/components/theme-button.tsx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/web/app/components/theme-button.tsx b/apps/web/app/components/theme-button.tsx new file mode 100644 index 00000000..eccb88f1 --- /dev/null +++ b/apps/web/app/components/theme-button.tsx @@ -0,0 +1,15 @@ +import { Theme, useTheme } from "~/lib/theme-provider"; + +function ThemeButton() { + const [theme, setTheme] = useTheme(); + return ( + <button + onClick={() => setTheme(theme === Theme.LIGHT ? Theme.DARK : Theme.LIGHT)} + className="rounded-md bg-secondary px-4 py-2 text-secondary-foreground transition-colors hover:bg-secondary/80" + > + {theme === Theme.LIGHT ? "Dark" : "Light"} Mode + </button> + ); +} + +export default ThemeButton; |