-
Notifications
You must be signed in to change notification settings - Fork 0
/
StyleProvider.tsx
36 lines (32 loc) · 1022 Bytes
/
StyleProvider.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { ColorSchemeProvider, MantineProvider } from '@mantine/core'
import { NotificationsProvider } from '@mantine/notifications'
import { ReactNode } from 'react'
import useColorScheme from '../hooks/common/useColorScheme'
type StyleProviderProps = {
children: ReactNode
}
/**
* Provides the application with a color scheme and the Mantine UI component library.
*/
const StyleProvider: React.FC<StyleProviderProps> = ({ children }) => {
const [colorScheme, toggleColorScheme] = useColorScheme()
return (
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={toggleColorScheme}>
<MantineProvider
theme={{
colorScheme,
globalStyles: () => ({
'a:has(button)': {
textDecoration: 'none'
}
})
}}
withGlobalStyles
withNormalizeCSS
>
<NotificationsProvider>{children}</NotificationsProvider>
</MantineProvider>
</ColorSchemeProvider>
)
}
export default StyleProvider