Skip to content

Commit

Permalink
feat: color mode switch style
Browse files Browse the repository at this point in the history
  • Loading branch information
lideming committed Nov 29, 2023
1 parent 4118933 commit 6a24d48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neetbox/frontend/src/components/themeSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { useCallback, useEffect, useState } from "react";
import { Button } from "@douyinfe/semi-ui";
import { Switch } from "@douyinfe/semi-ui";
import { ThemeContext, useTheme } from "../hooks/useTheme";

export default function SwitchColorMode(): React.JSX.Element {
const { darkMode, setDarkMode } = useTheme();
const switchMode = () => {
setDarkMode(!darkMode);
};
return <Button onClick={switchMode}>Switch Mode</Button>;
return <Switch size="large" checkedText="☀️" checked={!darkMode} onChange={switchMode}></Switch>;
}

export function ThemeContextProvider(props: React.PropsWithChildren) {
Expand Down

0 comments on commit 6a24d48

Please sign in to comment.