[d76b7ee] | 1 | import React from 'react'
|
---|
| 2 | import {Menu} from "antd";
|
---|
| 3 | import {Link, useNavigate} from "react-router-dom";
|
---|
| 4 | import {Outlet} from "react-router";
|
---|
| 5 | import {BookOutlined, BulbOutlined, ContainerOutlined, QuestionCircleOutlined, UserOutlined} from "@ant-design/icons";
|
---|
| 6 | import * as PropTypes from "prop-types";
|
---|
| 7 | import {Header} from "./Header";
|
---|
| 8 |
|
---|
| 9 | Header.propTypes = {onClick: PropTypes.func};
|
---|
| 10 | const 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 |
|
---|
| 49 | export default Dashboard |
---|