From c4414e9c62ef8242a438a8303f1379cda535cd6c Mon Sep 17 00:00:00 2001 From: Ethan Date: Mon, 25 Aug 2025 16:00:22 +0930 Subject: [PATCH] Add: Add a Home Button on the Dashboard --- public/dashboard/sidebar/home.svg | 4 ++++ src/components/layout/dashboard-layout/Sidebar.tsx | 6 ++++++ src/components/layout/dashboard-layout/UserProfileMenu.tsx | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 public/dashboard/sidebar/home.svg diff --git a/public/dashboard/sidebar/home.svg b/public/dashboard/sidebar/home.svg new file mode 100644 index 0000000..31da110 --- /dev/null +++ b/public/dashboard/sidebar/home.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/layout/dashboard-layout/Sidebar.tsx b/src/components/layout/dashboard-layout/Sidebar.tsx index 0bc6259..0cd5f99 100644 --- a/src/components/layout/dashboard-layout/Sidebar.tsx +++ b/src/components/layout/dashboard-layout/Sidebar.tsx @@ -94,6 +94,12 @@ const navItems = [ ]; const dropdownOptions = [ + { + label: 'Home', + iconSrc: '/dashboard/sidebar/home.svg', + iconAlt: 'Home', + action: 'home', + }, { label: 'Switch Account', iconSrc: '/dashboard/sidebar/account-switch.svg', diff --git a/src/components/layout/dashboard-layout/UserProfileMenu.tsx b/src/components/layout/dashboard-layout/UserProfileMenu.tsx index fa80702..9943a96 100644 --- a/src/components/layout/dashboard-layout/UserProfileMenu.tsx +++ b/src/components/layout/dashboard-layout/UserProfileMenu.tsx @@ -54,6 +54,8 @@ export default function UserProfileMenu({ if (option.action === 'logout') { dispatch(logout()); router.push('/login'); + } else if (option.action === 'home') { + router.push('/'); } handleMenuClose(); };