Changeset 7e88e46 for phonelux-frontend/src/components/NavbarComponent
- Timestamp:
- 09/17/22 01:24:24 (2 years ago)
- Branches:
- master
- Children:
- 5201690
- Parents:
- 775e15e
- Location:
- phonelux-frontend/src/components/NavbarComponent
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-frontend/src/components/NavbarComponent/NavbarComponent.css
r775e15e r7e88e46 9 9 } 10 10 11 .navbar-logout-box-icon{ 12 font-size: 40px; 13 margin-top: 10px; 14 } 15 11 16 .navbar-account-box-icon:hover{ 12 17 cursor: pointer; 13 18 } 14 19 20 .navbar-logout-box-icon:hover{ 21 cursor: pointer; 22 } 15 23 16 /* style={{ fontSize: '50px', marginTop: '10px' }} */ 24 .navbar-favouriteoffers-icon:hover{ 25 cursor: pointer; 26 } 27 28 .navbar-superadmin-icon:hover{ 29 cursor: pointer; 30 } 31 -
phonelux-frontend/src/components/NavbarComponent/NavbarComponent.js
r775e15e r7e88e46 8 8 import PersonIcon from '@mui/icons-material/Person'; 9 9 import LogoutIcon from '@mui/icons-material/Logout'; 10 import StarsIcon from '@mui/icons-material/Stars'; 11 import UserContext from '../../context/UserContext'; 12 import SupervisorAccountIcon from '@mui/icons-material/SupervisorAccount'; 10 13 11 14 export class NavbarComponent extends Component { … … 15 18 16 19 this.state = { 17 profileSectionOpen: false20 18 21 } 22 } 23 24 logOut = () => { 25 localStorage.clear() 26 window.location.href = "/" 19 27 } 20 28 … … 22 30 return ( 23 31 <div className='phonelux-navbar'> 32 { 33 localStorage.getItem('token') && this.context.role == 'SUPERADMIN' ? 34 <Tippy placement='bottom' content='Менаџмент со корисници'> 35 <Link style={{color: 'black'}} to={"/management/users"}> 36 <SupervisorAccountIcon style={{fontSize: '40px', marginTop: '10px', marginRight: '10px' }} className='navbar-superadmin-icon'/> 37 </Link> 38 </Tippy> : <></> 39 } 40 { 41 localStorage.getItem('token') ? 42 <Tippy placement='bottom' content='Омилени понуди'> 43 <Link style={{color: 'black'}} to={"/user/"+this.context.userId+"/favouriteoffers"}> 44 <StarsIcon style={{fontSize: '40px', marginTop: '10px', marginRight: '10px' }} className='navbar-favouriteoffers-icon'/> 45 </Link> 46 </Tippy> : <></> 47 } 48 49 { localStorage.getItem('token') ? 50 <Tippy placement='bottom' content='Одјави се'> 51 <LogoutIcon onClick={this.logOut} style={{fontSize: '40px', marginTop: '10px' }} className='navbar-logout-box-icon'/> 52 </Tippy> 53 : 24 54 <Tippy placement='bottom' content='Најави се'> 25 55 <Link style={{color: 'black'}} to={"/login"}> <PersonIcon style={{fontSize: '50px', marginTop: '10px' }} className='navbar-account-box-icon'/></Link> 26 56 </Tippy> 57 } 27 58 28 {/* favourite offers icon goes here */}29 59 30 60 </div> … … 33 63 } 34 64 65 NavbarComponent.contextType = UserContext 66 35 67 export default NavbarComponent
Note:
See TracChangeset
for help on using the changeset viewer.