2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-07 12:22:11 +00:00

add basic theme

This commit is contained in:
Matthias Mair
2024-04-15 01:12:06 +02:00
parent 8e41ddc53a
commit 6b83a376f5
2 changed files with 18 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
import { createTheme } from '@mantine/core';
import { themeToVars } from '@mantine/vanilla-extract';
export const theme = createTheme({});
export const vars = themeToVars(theme);

View File

@@ -1,9 +1,12 @@
import { MantineProvider } from '@mantine/core';
import '@mantine/core/styles.css';
import { useViewportSize } from '@mantine/hooks';
import { lazy, useEffect } from 'react';
import { setApiDefaults } from '../App';
import { Loadable } from '../functions/loading';
import { useLocalState } from '../states/LocalState';
import { theme } from '../theme';
function checkMobile() {
const { height, width } = useViewportSize();
@@ -25,9 +28,17 @@ export default function MainView() {
// Check if mobile
if (!allowMobile && checkMobile()) {
return <MobileAppView />;
return (
<MantineProvider theme={theme}>
<MobileAppView />
</MantineProvider>
);
}
// Main App component
return <DesktopAppView />;
return (
<MantineProvider theme={theme}>
<DesktopAppView />
</MantineProvider>
);
}