Skip to content

Commit a18b47a

Browse files
Ethan9527Jasguming
andauthored
Add: Add a Home Button on the Dashboard (#199)
Co-authored-by: Depeng Sun <[email protected]>
1 parent 0af19de commit a18b47a

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

public/dashboard/sidebar/home.svg

Lines changed: 4 additions & 0 deletions
Loading

src/components/layout/dashboard-layout/Sidebar.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ const navItems = [
9494
];
9595

9696
const dropdownOptions = [
97+
{
98+
label: 'Home',
99+
iconSrc: '/dashboard/sidebar/home.svg',
100+
iconAlt: 'Home',
101+
action: 'home',
102+
},
97103
{
98104
label: 'Switch Account',
99105
iconSrc: '/dashboard/sidebar/account-switch.svg',

src/components/layout/dashboard-layout/UserProfileMenu.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export default function UserProfileMenu({
5454
if (option.action === 'logout') {
5555
dispatch(logout());
5656
router.push('/login');
57+
} else if (option.action === 'home') {
58+
router.push('/');
5759
}
5860
handleMenuClose();
5961
};

0 commit comments

Comments
 (0)