refactor(structure):去掉路由控制。
This commit is contained in:
parent
010fb1995d
commit
ebc7c26522
|
@ -3,8 +3,7 @@ import { useColorScheme } from '@mantine/hooks';
|
||||||
import { Notifications } from '@mantine/notifications';
|
import { Notifications } from '@mantine/notifications';
|
||||||
import React, { FC, useState } from 'react';
|
import React, { FC, useState } from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
import { RouterProvider } from 'react-router-dom';
|
import { MainLayout } from './MainLayout';
|
||||||
import { appRouter } from './router';
|
|
||||||
import { useAppTheme } from './theme';
|
import { useAppTheme } from './theme';
|
||||||
|
|
||||||
const AppMain: FC = () => {
|
const AppMain: FC = () => {
|
||||||
|
@ -17,7 +16,7 @@ const AppMain: FC = () => {
|
||||||
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={setColorScheme}>
|
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={setColorScheme}>
|
||||||
<MantineProvider theme={theme} withGlobalStyles withNormalizeCSS>
|
<MantineProvider theme={theme} withGlobalStyles withNormalizeCSS>
|
||||||
<Notifications position="bottom-right" limit={5} zIndex={999} />
|
<Notifications position="bottom-right" limit={5} zIndex={999} />
|
||||||
<RouterProvider router={appRouter} />
|
<MainLayout />
|
||||||
</MantineProvider>
|
</MantineProvider>
|
||||||
</ColorSchemeProvider>
|
</ColorSchemeProvider>
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
import { createBrowserRouter } from "react-router-dom";
|
|
||||||
import { MainLayout } from "./MainLayout";
|
|
||||||
|
|
||||||
export const appRouter = createBrowserRouter([
|
|
||||||
{
|
|
||||||
path: "/",
|
|
||||||
element: <MainLayout />,
|
|
||||||
},
|
|
||||||
]);
|
|
Loading…
Reference in New Issue
Block a user