Skip to content

Commit

Permalink
fix(): Reamove default useTheme props.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Dec 27, 2023
1 parent bfadd98 commit 1fee055
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/molecules/theme-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Button } from "src/atoms/button";
import { theme as _theme } from "src/utils";

type Mode = ReturnType<typeof _theme['get']>['mode']
export const useTheme = (props: {defaultMode?: Mode }) => {
const mode = props.defaultMode ?? "dark"
const [theme, _setTheme] = React.useState<ReturnType<typeof _theme['get']>>({mode, isDark: _theme.isDark(mode)});
export const useTheme = () => {

const [theme, _setTheme] = React.useState<ReturnType<typeof _theme['get']>>({mode: "dark", isDark: true});
React.useEffect(() => {
_theme.subscribe(() => {
_setTheme(_theme.get());
Expand Down

0 comments on commit 1fee055

Please sign in to comment.