source: phonelux-frontend/src/components/NavbarComponent/NavbarComponent.js@ d66b8eb

Last change on this file since d66b8eb was d66b8eb, checked in by Marko <Marko@…>, 22 months ago

Component for editing offers added

  • Property mode set to 100644
File size: 2.8 KB
Line 
1import React, { Component } from 'react'
2import './NavbarComponent.css'
3import AccountBoxIcon from '@mui/icons-material/AccountBox';
4import { style } from '@mui/system';
5import Tippy from '@tippyjs/react';
6import 'tippy.js/dist/tippy.css'
7import { Link } from 'react-router-dom';
8import PersonIcon from '@mui/icons-material/Person';
9import LogoutIcon from '@mui/icons-material/Logout';
10import StarsIcon from '@mui/icons-material/Stars';
11import UserContext from '../../context/UserContext';
12import SupervisorAccountIcon from '@mui/icons-material/SupervisorAccount';
13import PhoneIphoneIcon from '@mui/icons-material/PhoneIphone';
14
15export class NavbarComponent extends Component {
16
17 constructor(props) {
18 super(props)
19
20 this.state = {
21
22 }
23 }
24
25 logOut = () => {
26 localStorage.clear()
27 window.location.href = "/"
28 }
29
30 render() {
31 return (
32 <div className='phonelux-navbar'>
33 {
34 localStorage.getItem('token') && this.context.role == 'SUPERADMIN' ?
35 <Tippy placement='bottom' content='Менаџмент со корисници'>
36 <Link style={{color: 'black'}} to={"/management/users"}>
37 <SupervisorAccountIcon style={{fontSize: '40px', marginTop: '10px', marginRight: '10px' }} className='navbar-superadmin-icon'/>
38 </Link>
39 </Tippy> : <></>
40 }
41 {
42 localStorage.getItem('token') ?
43 <Tippy placement='bottom' content='Споредба на мобилни телефони'>
44 <Link style={{color: 'black'}} to={"/compareoffers"}>
45 <PhoneIphoneIcon style={{fontSize: '40px', marginTop: '10px', marginRight: '10px' }} className='navbar-comparephone-icon'/>
46 </Link>
47 </Tippy> : <></>
48 }
49 {
50 localStorage.getItem('token') ?
51 <Tippy placement='bottom' content='Омилени понуди'>
52 <Link style={{color: 'black'}} to={"/user/"+this.context.userId+"/favouriteoffers"}>
53 <StarsIcon style={{fontSize: '40px', marginTop: '10px', marginRight: '10px' }} className='navbar-favouriteoffers-icon'/>
54 </Link>
55 </Tippy> : <></>
56 }
57
58 { localStorage.getItem('token') ?
59 <Tippy placement='bottom' content='Одјави се'>
60 <LogoutIcon onClick={this.logOut} style={{fontSize: '40px', marginTop: '10px' }} className='navbar-logout-box-icon'/>
61 </Tippy>
62 :
63 <Tippy placement='bottom' content='Најави се'>
64 <Link style={{color: 'black'}} to={"/login"}> <PersonIcon style={{fontSize: '50px', marginTop: '10px' }} className='navbar-account-box-icon'/></Link>
65 </Tippy>
66 }
67
68
69 </div>
70 )
71 }
72}
73
74NavbarComponent.contextType = UserContext
75
76export default NavbarComponent
Note: See TracBrowser for help on using the repository browser.