This repository was archived by the owner on Mar 8, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -15,25 +15,26 @@ import { InitialCookiesProvider } from './InitialCookieProvider';
1515
1616type Props = PropsWithChildren < {
1717 theme ?: Dict ;
18- initialColorMode ?: 'dark' | 'light' ;
18+ /** color mode of theme, default: light */
19+ colorMode ?: 'dark' | 'light' ;
1920 enableColorModeScript ?: boolean ;
2021} > ;
2122
2223const cookieKey = 'chakra-ui-color-mode' ;
2324export const DesignProvider = ( {
2425 children,
2526 theme,
26- initialColorMode = 'light' ,
27+ colorMode = 'light' ,
2728 enableColorModeScript = true ,
2829} : Props ) => {
2930 return (
30- < InitialCookiesProvider cookies = { [ { name : cookieKey , value : initialColorMode } ] } >
31+ < InitialCookiesProvider cookies = { [ { name : cookieKey , value : colorMode } ] } >
3132 { enableColorModeScript ? (
32- < ColorModeScript initialColorMode = { initialColorMode } type = { 'cookie' } />
33+ < ColorModeScript initialColorMode = { colorMode } type = { 'cookie' } />
3334 ) : null }
3435 < StyledComponentsRegistry >
3536 < ChakraProvider
36- colorModeManager = { cookieStorageManagerSSR ( `cookieKey=${ initialColorMode } ` ) }
37+ colorModeManager = { cookieStorageManagerSSR ( `${ cookieKey } =${ colorMode } ` ) }
3738 theme = { theme ?? baseTheme }
3839 >
3940 < AppAlertDialogProvider > { children } </ AppAlertDialogProvider >
You can’t perform that action at this time.
0 commit comments