Skip to content
This repository was archived by the owner on Mar 8, 2025. It is now read-only.

Commit af1e21a

Browse files
committed
feat: change colorMode prop name
1 parent b862ea8 commit af1e21a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/provider/DesignProvider.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,26 @@ import { InitialCookiesProvider } from './InitialCookieProvider';
1515

1616
type 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

2223
const cookieKey = 'chakra-ui-color-mode';
2324
export 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>

0 commit comments

Comments
 (0)