Browse Source

Toggle dark mode in menu

master
Archie 1 week ago
parent
commit
b0c9f00c26
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      src/components/Page.js

+ 9
- 1
src/components/Page.js View File

@ -21,7 +21,7 @@ import { useTheme } from "../utils/theme";
export const Page = ({ children, title, breadcrumbs, head, width }) => {
const user = useUser();
useTheme();
const { theme, setTheme } = useTheme();
const logOut = () => {
const isProduction = process.env.NODE_ENV === "production";
@ -80,6 +80,14 @@ export const Page = ({ children, title, breadcrumbs, head, width }) => {
>
<Menu.Item>Profile Page</Menu.Item>
</Link>
<Menu.Item
onClick={() =>
setTheme(theme === "light" ? "dark" : "light")
}
className="cursor-pointer"
>
{theme === "light" ? "Dark" : "Light"} Mode
</Menu.Item>
<Menu.Item
onClick={() => logOut()}
className="cursor-pointer"

Loading…
Cancel
Save