This commit is contained in:
yohlo
2025-08-20 22:35:40 -05:00
commit f51c278cd3
169 changed files with 8173 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
import { useAuth } from "@/contexts/auth-context";
import { createTheme, MantineProvider as MantineProviderCore } from "@mantine/core";
import ColorSchemeProvider from "./color-scheme-provider";
const commonInputStyles = {
label: {
padding: 5
},
root: {
margin: '0'
}
}
const theme = createTheme({
defaultRadius: 'sm',
components: {
TextInput: {
styles: commonInputStyles
},
DateTimePicker: {
styles: commonInputStyles
},
Input: {
styles: commonInputStyles
},
Select: {
styles: commonInputStyles
},
Autocomplete: {
styles: commonInputStyles
},
DateTiemPicker: {
styles: {
root: {
zIndex: 1000
},
input: {
zIndex: 1000,
backgroundColor: 'red'
}
}
}
},
});
const MantineProvider = ({ children }: { children: React.ReactNode }) => {
const { metadata } = useAuth()
return <MantineProviderCore
defaultColorScheme={metadata.colorScheme || 'auto'}
theme={{ ...theme, primaryColor: metadata.accentColor || 'blue' }}
>
<ColorSchemeProvider>
{children}
</ColorSchemeProvider>
</MantineProviderCore>
}
export default MantineProvider;