Browse Source

Add Layout to App (#588)

pull/13907/head
Alejandra 2 years ago
committed by GitHub
parent
commit
b950fd7389
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      src/new-frontend/src/App.tsx
  2. 5
      src/new-frontend/src/pages/Layout.tsx

3
src/new-frontend/src/App.tsx

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

5
src/new-frontend/src/pages/Layout.tsx

@ -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>
);
};

Loading…
Cancel
Save