refactor: migrate investor dashboard to dedicated subfolder and update navigation paths

This commit is contained in:
sazzadulalambd
2026-05-15 02:47:48 +06:00
parent 0c1a6e3a18
commit 44745d0252
3 changed files with 10 additions and 6 deletions

View File

@@ -57,7 +57,7 @@ export default function LoginPage() {
router.push('/admin/accounting');
break;
case 'investor':
router.push('/investor');
router.push('/investor/dashboard');
break;
case 'biker':
router.push('/biker');
@@ -110,7 +110,7 @@ export default function LoginPage() {
router.push('/admin/accounting');
break;
case 'investor':
router.push('/investor');
router.push('/investor/dashboard');
break;
case 'biker':
router.push('/biker');

View File

@@ -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