-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.js
49 lines (47 loc) · 1.49 KB
/
Test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import * as React from 'react';
import Box from '@mui/material/Box';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import { Header } from './Header';
import React from 'react';
import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';
import { routes } from './routes';
import Home from './container/Home';
import Booking from './container/Booking';
import Contact from './container/Contact';
import Services from './container/Services';
//This would be the my app.js
export const Test = () => {
return (
<Router>
<Header />
<Box sx={{ display: 'flex' }}>
<Box className={'nav'}>
<List>
{routes.map((item, index) => (
<Link to={item.path}>
<ListItem button key={index}>
<ListItemText primary={item.displayName} />
</ListItem>
</Link>
))}
</List>
</Box>
{/* </Drawer> */}
<Box component="main" sx={{ flexGrow: 1, p: 3 }}>
<Switch>
{routes.map((item, index) => {
return (
<Route exact key={index} path={item.path}>
{item.component}
</Route>
);
})}
</Switch>
</Box>
</Box>
</Router>
);
};