source: frontend/src/Dashboard.js@ a569b7c

Last change on this file since a569b7c was a26f6a1, checked in by Danilo <danilo.najkov@…>, 2 years ago

full auth flow

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[d76b7ee]1import React from 'react'
2import {Menu} from "antd";
3import {Link, useNavigate} from "react-router-dom";
4import {Outlet} from "react-router";
5import {BookOutlined, BulbOutlined, ContainerOutlined, QuestionCircleOutlined, UserOutlined} from "@ant-design/icons";
6import * as PropTypes from "prop-types";
7import {Header} from "./Header";
8
9Header.propTypes = {onClick: PropTypes.func};
10const Dashboard = ({setUser}) => {
11 const history = useNavigate()
12 const logout = () => {
[a26f6a1]13 localStorage.removeItem('Auth');
[d76b7ee]14 setUser(false)
15 }
16 return(
17 <div>
18 <Header onClickButton={() => logout()} buttonText={'Одјави се'}/>
19 <div style={{width: '20%', display: 'inline-block', verticalAlign: 'top'}}>
20 <Menu
21 style={{width: '100%'}}
22 defaultSelectedKeys={['1']}
23 mode="inline"
24 >
25 <Menu.Item key="1" icon={<BulbOutlined/>}><Link to="/dashboard">Ресторан</Link></Menu.Item>
26 <Menu.Item key="2" icon={<ContainerOutlined/>}><Link to="/dashboard/menu">Мени</Link></Menu.Item>
27 <Menu.Item key="3" icon={<UserOutlined/>}><Link
28 to="/dashboard/reservations">Резервации</Link></Menu.Item>
29 <Menu.Item key="4" icon={<QuestionCircleOutlined/>}><Link
[cc4db18]30 to="/dashboard/reviews">Оценки</Link></Menu.Item>
31 <Menu.Item key="5" icon={<BookOutlined/>}><Link to="/dashboard/todo">ToDo</Link></Menu.Item>
[d76b7ee]32 </Menu>
33 </div>
34 <div style={{
35 width: '80%',
36 display: 'inline-block',
37 backgroundColor: '#F2F2F2',
38 verticalAlign: 'top',
39 textAlign: 'center',
40 height: '92vh',
41 overflow: 'auto'
42 }}>
43 <Outlet/>
44 </div>
45 </div>
46 )
47}
48
49export default Dashboard
Note: See TracBrowser for help on using the repository browser.