mirror of
https://github.com/mosh-hamedani/game-hub.git
synced 2026-05-21 12:14:32 +02:00
Implement dark mode
This commit is contained in:
parent
f54b49d70c
commit
7b9df30d05
|
|
@ -1,12 +1,14 @@
|
|||
import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import { ChakraProvider } from '@chakra-ui/react'
|
||||
import { ChakraProvider, ColorModeScript } from '@chakra-ui/react'
|
||||
import App from './App'
|
||||
import theme from './theme'
|
||||
import './index.css'
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<ChakraProvider>
|
||||
<ChakraProvider theme={theme}>
|
||||
<ColorModeScript initialColorMode={theme.config.initialColorMode}/>
|
||||
<App />
|
||||
</ChakraProvider>
|
||||
</React.StrictMode>,
|
||||
|
|
|
|||
9
src/theme.ts
Normal file
9
src/theme.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { extendTheme, ThemeConfig } from "@chakra-ui/react";
|
||||
|
||||
const config: ThemeConfig = {
|
||||
initialColorMode: 'dark'
|
||||
};
|
||||
|
||||
const theme = extendTheme({ config });
|
||||
|
||||
export default theme;
|
||||
Loading…
Reference in a new issue