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:
5
src/frontend/src/theme.ts
Normal file
5
src/frontend/src/theme.ts
Normal 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);
|
@@ -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>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user