mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-10 05:40:55 +00:00
move language context around
This commit is contained in:
@@ -1,15 +1,12 @@
|
|||||||
import { QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClientProvider } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { queryClient } from '../App';
|
import { queryClient } from '../App';
|
||||||
import { LanguageContext } from './LanguageContext';
|
|
||||||
import { ThemeContext } from './ThemeContext';
|
import { ThemeContext } from './ThemeContext';
|
||||||
|
|
||||||
export const BaseContext = ({ children }: { children: any }) => {
|
export const BaseContext = ({ children }: { children: any }) => {
|
||||||
return (
|
return (
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<ThemeContext>
|
<ThemeContext>{children}</ThemeContext>
|
||||||
<LanguageContext>{children}</LanguageContext>
|
|
||||||
</ThemeContext>
|
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@@ -8,6 +8,7 @@ import { LicenseModal } from '../components/modals/LicenseModal';
|
|||||||
import { QrCodeModal } from '../components/modals/QrCodeModal';
|
import { QrCodeModal } from '../components/modals/QrCodeModal';
|
||||||
import { ServerInfoModal } from '../components/modals/ServerInfoModal';
|
import { ServerInfoModal } from '../components/modals/ServerInfoModal';
|
||||||
import { useLocalState } from '../states/LocalState';
|
import { useLocalState } from '../states/LocalState';
|
||||||
|
import { LanguageContext } from './LanguageContext';
|
||||||
import { colorSchema } from './colorSchema';
|
import { colorSchema } from './colorSchema';
|
||||||
|
|
||||||
export function ThemeContext({ children }: { children: JSX.Element }) {
|
export function ThemeContext({ children }: { children: JSX.Element }) {
|
||||||
@@ -37,18 +38,20 @@ export function ThemeContext({ children }: { children: JSX.Element }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<MantineProvider theme={myTheme} colorSchemeManager={colorSchema}>
|
<MantineProvider theme={myTheme} colorSchemeManager={colorSchema}>
|
||||||
<Notifications />
|
<LanguageContext>
|
||||||
<ModalsProvider
|
<ModalsProvider
|
||||||
labels={{ confirm: t`Submit`, cancel: t`Cancel` }}
|
labels={{ confirm: t`Submit`, cancel: t`Cancel` }}
|
||||||
modals={{
|
modals={{
|
||||||
qr: QrCodeModal,
|
qr: QrCodeModal,
|
||||||
info: ServerInfoModal,
|
info: ServerInfoModal,
|
||||||
about: AboutInvenTreeModal,
|
about: AboutInvenTreeModal,
|
||||||
license: LicenseModal
|
license: LicenseModal
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
<Notifications />
|
||||||
</ModalsProvider>
|
{children}
|
||||||
|
</ModalsProvider>
|
||||||
|
</LanguageContext>
|
||||||
</MantineProvider>
|
</MantineProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user