Files
pawol.nu/app/theme-registy.js
T

86 lines
1.9 KiB
JavaScript
Raw Normal View History

2023-07-22 13:02:59 +04:00
'use client'
import PropTypes from 'prop-types'
2024-10-21 15:18:37 +04:00
import {createTheme, ThemeProvider} from '@mui/material/styles'
2024-10-21 09:55:57 +04:00
import InitColorSchemeScript from '@mui/material/InitColorSchemeScript'
2023-07-22 13:02:59 +04:00
import CssBaseline from '@mui/material/CssBaseline'
2023-07-26 08:05:23 +04:00
import {grey, green, yellow} from '@mui/material/colors'
2023-07-22 13:02:59 +04:00
import '@fontsource/roboto/300.css'
import '@fontsource/roboto/400.css'
import '@fontsource/roboto/500.css'
import '@fontsource/roboto/700.css'
import '../styles/nprogress.css'
import ChanjeTem from '../components/chanje-tem'
import NextAppDirEmotionCacheProvider from './emotion-cache-provider'
2024-10-21 15:18:37 +04:00
const theme = createTheme({
2024-10-21 18:37:48 +04:00
cssVariables: {
colorSchemeSelector: 'class'
},
colorSchemes: {
light: {
palette: {
2023-07-22 13:02:59 +04:00
primary: green,
2023-07-26 08:05:23 +04:00
secondary: {
main: green[50]
},
2023-07-22 13:02:59 +04:00
divider: green[200],
info: {
main: grey[900]
},
text: {
primary: grey[900],
secondary: grey[800],
},
}
},
dark: {
palette: {
2023-07-22 13:02:59 +04:00
primary: {
main: yellow[500],
contrastText: '#000'
},
2023-07-26 08:05:23 +04:00
secondary: {
main: yellow[500]
},
2023-07-22 13:02:59 +04:00
info: {
main: '#fff'
},
divider: green[700],
background: {
default: '#082211',
paper: '#082211'
2023-07-22 13:02:59 +04:00
},
text: {
primary: '#fff',
secondary: grey[100]
}
}
}
}
2023-07-22 13:02:59 +04:00
})
export default function ThemeRegistry(props) {
const {children} = props
return (
<>
2024-10-21 18:37:48 +04:00
<InitColorSchemeScript attribute='class' />
<NextAppDirEmotionCacheProvider options={{key: 'mui'}}>
2024-10-21 09:55:57 +04:00
<ThemeProvider theme={theme}>
2023-07-22 14:30:07 +04:00
<CssBaseline enableColorScheme />
<ChanjeTem />
{children}
2024-10-21 09:55:57 +04:00
</ThemeProvider>
</NextAppDirEmotionCacheProvider>
</>
2023-07-22 13:02:59 +04:00
)
}
ThemeRegistry.propTypes = {
children: PropTypes.node.isRequired
}