Skip to content

Commit d22f85c

Browse files
committed
feat: Add ColorModeProvider for dark mode support
1 parent ad5812b commit d22f85c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/pages/_app.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react'
22
import App from 'next/app'
33
import ThemeProvider from '@chakra-ui/core/dist/ThemeProvider'
4+
import ColorModeProvider from '@chakra-ui/core/dist/ColorModeProvider'
45
import CSSReset, { CSSResetProps } from '@chakra-ui/core/dist/CSSReset'
56
import { Global, css, SerializedStyles } from '@emotion/core'
67
import { defaultTheme, Theme } from '../ui/theme'
@@ -55,11 +56,13 @@ export function createChakraNextApp(
5556
const { Component, pageProps } = this.props
5657
return (
5758
<ThemeProvider theme={theme}>
58-
<CSSReset config={getGlobalConfig} />
59-
<Global styles={[globalCss]} />
60-
<Providers>
61-
<Component {...pageProps} />
62-
</Providers>
59+
<ColorModeProvider>
60+
<CSSReset config={getGlobalConfig} />
61+
<Global styles={[globalCss]} />
62+
<Providers>
63+
<Component {...pageProps} />
64+
</Providers>
65+
</ColorModeProvider>
6366
</ThemeProvider>
6467
)
6568
}

0 commit comments

Comments
 (0)