fix(layout):修复基本布局。
This commit is contained in:
parent
be5675cd5c
commit
aae96a632b
25
src/main.tsx
25
src/main.tsx
|
@ -1,9 +1,11 @@
|
||||||
import { NotificationsProvider } from "@mantine/notifications";
|
import { ColorScheme, ColorSchemeProvider, MantineProvider } from '@mantine/core';
|
||||||
import React, { FC, useState } from "react";
|
import { useColorScheme } from '@mantine/hooks';
|
||||||
import ReactDOM from "react-dom/client";
|
import { Notifications } from '@mantine/notifications';
|
||||||
import { RouterProvider } from "react-router-dom";
|
import React, { FC, useState } from 'react';
|
||||||
import { appRouter } from "./router";
|
import ReactDOM from 'react-dom/client';
|
||||||
import { useAppTheme } from "./theme";
|
import { RouterProvider } from 'react-router-dom';
|
||||||
|
import { appRouter } from './router';
|
||||||
|
import { useAppTheme } from './theme';
|
||||||
|
|
||||||
const AppMain: FC = () => {
|
const AppMain: FC = () => {
|
||||||
const preferredColorScheme = useColorScheme();
|
const preferredColorScheme = useColorScheme();
|
||||||
|
@ -14,17 +16,12 @@ const AppMain: FC = () => {
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={setColorScheme}>
|
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={setColorScheme}>
|
||||||
<MantineProvider theme={theme} withGlobalStyles withNormalizeCSS>
|
<MantineProvider theme={theme} withGlobalStyles withNormalizeCSS>
|
||||||
<NotificationsProvider position="bottom-right" limit={5} zIndex={999}>
|
<Notifications position="bottom-right" limit={5} zIndex={999} />
|
||||||
<RouterProvider router={appRouter} />
|
<RouterProvider router={appRouter} />
|
||||||
</NotificationsProvider>
|
|
||||||
</MantineProvider>
|
</MantineProvider>
|
||||||
</ColorSchemeProvider>
|
</ColorSchemeProvider>
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(<AppMain />);
|
||||||
<React.StrictMode>
|
|
||||||
<AppMain />
|
|
||||||
</React.StrictMode>
|
|
||||||
);
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user