refactor(structure):去掉路由控制。

This commit is contained in:
徐涛 2023-03-08 12:22:56 +08:00
parent 010fb1995d
commit ebc7c26522
2 changed files with 2 additions and 12 deletions

View File

@ -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>

View File

@ -1,9 +0,0 @@
import { createBrowserRouter } from "react-router-dom";
import { MainLayout } from "./MainLayout";
export const appRouter = createBrowserRouter([
{
path: "/",
element: <MainLayout />,
},
]);