refactor: migrate investor dashboard to dedicated subfolder and update navigation paths
This commit is contained in:
@@ -65,7 +65,7 @@ const bikerNavItems = [
|
||||
];
|
||||
|
||||
const investorNavItems = [
|
||||
{ label: 'Dashboard', href: '/investor', icon: Bike },
|
||||
{ label: 'Dashboard', href: '/investor/dashboard', icon: Bike },
|
||||
{ label: 'My Investments', href: '/investor/plans', icon: Target },
|
||||
{ label: 'Rental History', href: '/investor/rental-history', icon: History },
|
||||
{ label: 'Withdraw', href: '/investor/withdraw', icon: CreditCard },
|
||||
@@ -105,7 +105,7 @@ export default function Sidebar() {
|
||||
{ label: 'Fleet', href: '/admin/fleet', icon: Bike },
|
||||
{ label: 'Users', href: '/admin/users', icon: Users },
|
||||
] : isInvestor ? [
|
||||
{ label: 'Home', href: '/investor', icon: Bike },
|
||||
{ label: 'Home', href: '/investor/dashboard', icon: Bike },
|
||||
{ label: 'Investments', href: '/investor/plans', icon: Target },
|
||||
{ label: 'History', href: '/investor/rental-history', icon: History },
|
||||
{ label: 'Withdraw', href: '/investor/withdraw', icon: CreditCard },
|
||||
@@ -149,7 +149,9 @@ export default function Sidebar() {
|
||||
|
||||
<nav className="p-3 space-y-1 overflow-y-auto h-[calc(100vh-140px)] pb-24 lg:pb-3">
|
||||
{navItems.map((item) => {
|
||||
const isActive = pathname === item.href || (item.href !== '/' && pathname.startsWith(item.href));
|
||||
const isExact = pathname === item.href;
|
||||
const isChild = item.href !== '/' && pathname.startsWith(item.href + '/');
|
||||
const isActive = isExact || isChild;
|
||||
const Icon = item.icon;
|
||||
return (
|
||||
<Link
|
||||
@@ -200,7 +202,9 @@ export default function Sidebar() {
|
||||
{/* Bottom Navigation for Mobile */}
|
||||
<nav className="lg:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-slate-200 flex items-center h-16 z-30 shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.05)]">
|
||||
{bottomNavItems.map((item) => {
|
||||
const isActive = pathname === item.href || (item.href !== '/' && pathname.startsWith(item.href));
|
||||
const isExact = pathname === item.href;
|
||||
const isChild = item.href !== '/' && pathname.startsWith(item.href + '/');
|
||||
const isActive = isExact || isChild;
|
||||
const Icon = item.icon;
|
||||
return (
|
||||
<Link
|
||||
|
||||
Reference in New Issue
Block a user