Add Layout to App (#588)

This commit is contained in:
Alejandra
2024-01-29 17:10:46 -05:00
committed by GitHub
parent 16f26df0c6
commit b950fd7389
2 changed files with 6 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import Layout from './pages/Layout';
import Login from './pages/auth/Login';
import RecoverPassword from './pages/auth/RecoverPassword';
@@ -9,6 +10,8 @@ function App() {
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/recover-password" element={<RecoverPassword />} />
<Route element={<Layout />}>
</Route>
</Routes>
</BrowserRouter>
)

View File

@@ -1,12 +1,13 @@
import { Outlet } from 'react-router-dom';
import Sidebar from '../components/Sidebar';
import { Flex } from '@chakra-ui/react';
const Layout = ({ children }: { children: React.ReactNode }) => {
const Layout = () => {
return (
<Flex maxW="large" h="auto" position="relative">
<Sidebar />
{children}
<Outlet />
</Flex>
);
};