Skip to content

Commit 3b6c256

Browse files
hugohezelmshriver
authored andcommitted
fix(IQE-3525): Expand the click area to the entire item area in User Dropdown
1 parent 462afd0 commit 3b6c256

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

frontend/src/components/user-dropdown.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import {
77
MenuToggle,
88
} from '@patternfly/react-core';
99
import { UserIcon } from '@patternfly/react-icons';
10-
import { Link } from 'react-router-dom';
10+
import { useNavigate } from 'react-router-dom';
1111

1212
import { AuthService } from '../services/auth';
1313

1414
const 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>

0 commit comments

Comments
 (0)