Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lerte committed Apr 15, 2024
1 parent c91b7eb commit 71c2391
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
5 changes: 4 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ const App = () => {
accentColor="crimson"
>
<EnableProvider>
<Zroker setTheme={setTheme} />
<Zroker
theme={theme}
setTheme={setTheme}
/>
</EnableProvider>
<Toaster
position="bottom-right"
Expand Down
15 changes: 10 additions & 5 deletions frontend/src/Zroker.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { isDark } from "./utils";
import Login from "./components/Login";
import { Sun, Moon } from "lucide-react";
import Overview from "./components/Overview";
import { useEnable } from "./contexts/Enable";
import { Sun, Moon } from "lucide-react";
import { Theme } from "./hooks/useAutoDark";
import { Box, Button, Flex } from "@radix-ui/themes";

const Zroker = ({ setTheme }: { setTheme: (theme: Theme) => void }) => {
const Zroker = ({
theme,
setTheme,
}: {
theme: Theme;
setTheme: (theme: Theme) => void;
}) => {
const { enable } = useEnable();

return (
Expand All @@ -17,9 +22,9 @@ const Zroker = ({ setTheme }: { setTheme: (theme: Theme) => void }) => {
size="4"
radius="full"
variant="ghost"
onClick={() => setTheme(isDark() ? "light" : "dark")}
onClick={() => setTheme(theme == "dark" ? "light" : "dark")}
>
{isDark() ? <Moon /> : <Sun />}
{theme == "dark" ? <Moon /> : <Sun />}
</Button>
</Box>
</Flex>
Expand Down

0 comments on commit 71c2391

Please sign in to comment.