File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,15 @@ import {
77 MenuToggle ,
88} from '@patternfly/react-core' ;
99import { UserIcon } from '@patternfly/react-icons' ;
10- import { Link } from 'react-router-dom' ;
10+ import { useNavigate } from 'react-router-dom' ;
1111
1212import { AuthService } from '../services/auth' ;
1313
1414const UserDropdown = ( ) => {
1515 const [ displayName , setDisplayName ] = useState ( 'User' ) ;
1616 const [ isDropdownOpen , setIsDropdownOpen ] = useState ( false ) ;
1717 const [ isSuperAdmin , setIsSuperAdmin ] = useState ( false ) ;
18+ const navigate = useNavigate ( ) ;
1819
1920 const logout = ( ) => {
2021 AuthService . logout ( ) ;
@@ -48,16 +49,16 @@ const UserDropdown = () => {
4849 ) }
4950 >
5051 < DropdownList >
51- < DropdownItem key = "profile" >
52- < Link to = "/profile/user" > Profile</ Link >
52+ < DropdownItem key = "profile" onClick = { ( ) => navigate ( '/profile/user' ) } >
53+ Profile
5354 </ DropdownItem >
5455 { ! ! isSuperAdmin && (
55- < DropdownItem key = "admin" >
56- < Link to = "/admin/home" > Administration</ Link >
56+ < DropdownItem key = "admin" onClick = { ( ) => navigate ( '/admin/home' ) } >
57+ Administration
5758 </ DropdownItem >
5859 ) }
5960 < DropdownItem key = "logout" onClick = { logout } >
60- < Link > Logout</ Link >
61+ Logout
6162 </ DropdownItem >
6263 </ DropdownList >
6364 </ Dropdown >
You can’t perform that action at this time.
0 commit comments