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 React, { FC, useState } from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { RouterProvider } from "react-router-dom";
|
||||
import { appRouter } from "./router";
|
||||
import { useAppTheme } from "./theme";
|
||||
import { ColorScheme, ColorSchemeProvider, MantineProvider } from '@mantine/core';
|
||||
import { useColorScheme } from '@mantine/hooks';
|
||||
import { Notifications } from '@mantine/notifications';
|
||||
import React, { FC, useState } from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import { RouterProvider } from 'react-router-dom';
|
||||
import { appRouter } from './router';
|
||||
import { useAppTheme } from './theme';
|
||||
|
||||
const AppMain: FC = () => {
|
||||
const preferredColorScheme = useColorScheme();
|
||||
|
@ -14,17 +16,12 @@ const AppMain: FC = () => {
|
|||
<React.StrictMode>
|
||||
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={setColorScheme}>
|
||||
<MantineProvider theme={theme} withGlobalStyles withNormalizeCSS>
|
||||
<NotificationsProvider position="bottom-right" limit={5} zIndex={999}>
|
||||
<RouterProvider router={appRouter} />
|
||||
</NotificationsProvider>
|
||||
<Notifications position="bottom-right" limit={5} zIndex={999} />
|
||||
<RouterProvider router={appRouter} />
|
||||
</MantineProvider>
|
||||
</ColorSchemeProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
};
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<AppMain />
|
||||
</React.StrictMode>
|
||||
);
|
||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(<AppMain />);
|
||||
|
|
Loading…
Reference in New Issue
Block a user