chore: dashboard

This commit is contained in:
lencx
2022-12-13 19:10:42 +08:00
parent 430d6e4af2
commit 8363ff234d
18 changed files with 169 additions and 141 deletions

22
src/routes.tsx vendored Normal file
View File

@@ -0,0 +1,22 @@
import { useLayoutEffect } from 'react';
import { useLocation, useRoutes } from 'react-router-dom';
import type { RouteObject } from 'react-router-dom';
import App from '@view/App';
const routes: RouteObject[] = [
{
path: '/',
element: <App />
}
];
export default () => {
const location = useLocation();
const pathname = location.pathname;
useLayoutEffect(() => {
const name = pathname.substring(1).replace(/\//gi, '_');
document.body.className = `${name ? name : 'main'}_screen`
}, [pathname]);
return useRoutes(routes);
};