diff --git a/.husky/commit-msg b/.husky/commit-msg index 2785bc1..ba59ddd 100644 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1 +1 @@ -yarn commitlint --edit $1 +yarn commitlint --edit $1 \ No newline at end of file diff --git a/src/provider/DesignProvider.tsx b/src/provider/DesignProvider.tsx index 1472bf8..1dbe30b 100644 --- a/src/provider/DesignProvider.tsx +++ b/src/provider/DesignProvider.tsx @@ -7,7 +7,6 @@ import { cookieStorageManagerSSR, } from '@chakra-ui/react'; import type { Dict } from '@chakra-ui/utils'; -import type { RequestCookie } from 'next/dist/compiled/@edge-runtime/cookies'; import { AppAlertDialogProvider } from '../component/dialog/AppAlertDialog'; import StyledComponentsRegistry from '../registry'; @@ -15,37 +14,26 @@ import StyledComponentsRegistry from '../registry'; import { InitialCookiesProvider } from './InitialCookieProvider'; type Props = PropsWithChildren<{ - cookies: RequestCookie[]; - cookiesString: string; theme?: Dict; - initialColorMode?: 'dark' | 'ligh'; + initialColorMode?: 'dark' | 'light'; enableColorModeScript?: boolean; }>; +const cookieKey = 'chakra-ui-color-mode'; export const DesignProvider = ({ children, - cookies, - cookiesString, theme, - initialColorMode, + initialColorMode = 'light', enableColorModeScript = true, }: Props) => { return ( - + {enableColorModeScript ? ( - i.name === 'chakra-ui-color-mode')?.value === 'dark' - ? 'dark' - : 'light' - } - type={'cookie'} - /> + ) : null} {children}