Changeset 19398ad for jobvista-frontend/src/views/static
- Timestamp:
- 05/16/24 23:09:21 (6 months ago)
- Branches:
- main
- Children:
- 28b3398
- Parents:
- d8b6c91
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/views/static/Header.js
rd8b6c91 r19398ad 5 5 import {AuthActions} from "../../redux/actions/authActions"; 6 6 import Roles from "../../enumerations/Roles"; 7 import {useNavigate} from "react-router"; 7 8 8 export const Header = ( ) => {9 export const Header = (props) => { 9 10 10 11 const auth = useSelector(state => state.auth.currentUser); 11 12 const dispatch = useDispatch(); 13 const navigator = useNavigate(); 12 14 13 const [role, setRole] = useState( null);14 const [username, setUsername] = useState( null);15 const [role, setRole] = useState(""); 16 const [username, setUsername] = useState(""); 15 17 16 18 const signOut = () => { … … 20 22 21 23 useEffect(() => { 22 23 24 if (auth) { 24 25 setRole(auth.role); … … 34 35 <div className="collapse navbar-collapse" id="navbarSupportedContent"> 35 36 <ul className="navbar-nav me-auto mb-2 mb-lg-0"> 36 <NavLink to="/" className="nav-item nav-link" activeClassName="active">Home</NavLink>37 <NavLink to="/" className="nav-item nav-link">Home</NavLink> 37 38 {role==Roles.JOBSEEKER && 38 39 <> 39 <NavLink to="/applications" className="nav-item nav-link" activeClassName="active">Applications</NavLink>40 <NavLink to="/favoritejobs" className="nav-item nav-link" activeClassName="active">Saved</NavLink>40 <NavLink to="/applications" className="nav-item nav-link" >Applications</NavLink> 41 <NavLink to="/favoritejobs" className="nav-item nav-link" >Saved</NavLink> 41 42 </> 42 43 … … 44 45 {role==Roles.RECRUITER && 45 46 <> 46 <NavLink to="/ jobadvertisements" className="nav-item nav-link" activeClassName="active">Job Advertisements</NavLink>47 <NavLink to="/favoritejobs" className="nav-item nav-link" activeClassName="active">Saved</NavLink>47 <NavLink to="/my-job-advertisements" className="nav-item nav-link" >Job Advertisements</NavLink> 48 <NavLink to="/favoritejobs" className="nav-item nav-link" >Saved</NavLink> 48 49 </> 49 50 } … … 61 62 62 63 63 <Link onClick={signOut} className="btn btn-outline-secondary">Log out</Link>64 <Link onClick={signOut} className="btn auth-secondary-btn">Log out</Link> 64 65 </> : 65 66 <> 66 <Link to="/signin" className="btn btn-outline-secondary">Sign in</Link>67 <Link to="/signin" className="btn auth-secondary-btn">Sign in</Link> 67 68 </> 68 69 }
Note:
See TracChangeset
for help on using the changeset viewer.