-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
8428767
commit 86bc49a
Showing
24 changed files
with
227 additions
and
617 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,31 +1,43 @@ | ||
import { Switch } from '@headlessui/react' | ||
import { useTheme } from 'next-themes'; | ||
import { Switch } from "@headlessui/react"; | ||
import { useTheme } from "next-themes"; | ||
|
||
function classNames(...classes) { | ||
return classes.filter(Boolean).join(' ') | ||
} | ||
return classes.filter(Boolean).join(" "); | ||
} | ||
|
||
const DarkModeToggler = () => { | ||
const { theme, setTheme } = useTheme(); | ||
const { theme, setTheme } = useTheme(); | ||
|
||
return ( | ||
<div> | ||
<label className="block text-sm font-medium leading-6"> | ||
Appearance | ||
</label> | ||
<select | ||
id="theme" | ||
name="theme" | ||
className="mt-2 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 ring-1 ring-inset ring-neutral-300 dark:ring-neutral-400/20 focus:ring-2 focus:ring-cesium-900 dark:bg-neutral-800" | ||
value={theme === "light" ? "Light" : theme === "dark" ? "Dark" : "Follow System"} | ||
onChange={(e) => setTheme(e.target.value === "Light" ? "light" : e.target.value === "Dark" ? "dark" : "system")} | ||
> | ||
<option>Follow System</option> | ||
<option>Dark</option> | ||
<option>Light</option> | ||
</select> | ||
</div> | ||
) | ||
} | ||
return ( | ||
<div> | ||
<label className="block text-sm font-medium leading-6">Appearance</label> | ||
<select | ||
id="theme" | ||
name="theme" | ||
className="mt-2 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 ring-1 ring-inset ring-neutral-300 focus:ring-2 focus:ring-cesium-900 dark:bg-neutral-800 dark:ring-neutral-400/20" | ||
value={ | ||
theme === "light" | ||
? "Light" | ||
: theme === "dark" | ||
? "Dark" | ||
: "Follow System" | ||
} | ||
onChange={(e) => | ||
setTheme( | ||
e.target.value === "Light" | ||
? "light" | ||
: e.target.value === "Dark" | ||
? "dark" | ||
: "system" | ||
) | ||
} | ||
> | ||
<option>Follow System</option> | ||
<option>Dark</option> | ||
<option>Light</option> | ||
</select> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DarkModeToggler; |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export { default } from './DarkModeToggler'; | ||
export { default } from "./DarkModeToggler"; |
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
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
Oops, something went wrong.