refactor: migrate investor dashboard to dedicated subfolder and update navigation paths
This commit is contained in:
@@ -57,7 +57,7 @@ export default function LoginPage() {
|
|||||||
router.push('/admin/accounting');
|
router.push('/admin/accounting');
|
||||||
break;
|
break;
|
||||||
case 'investor':
|
case 'investor':
|
||||||
router.push('/investor');
|
router.push('/investor/dashboard');
|
||||||
break;
|
break;
|
||||||
case 'biker':
|
case 'biker':
|
||||||
router.push('/biker');
|
router.push('/biker');
|
||||||
@@ -110,7 +110,7 @@ export default function LoginPage() {
|
|||||||
router.push('/admin/accounting');
|
router.push('/admin/accounting');
|
||||||
break;
|
break;
|
||||||
case 'investor':
|
case 'investor':
|
||||||
router.push('/investor');
|
router.push('/investor/dashboard');
|
||||||
break;
|
break;
|
||||||
case 'biker':
|
case 'biker':
|
||||||
router.push('/biker');
|
router.push('/biker');
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const bikerNavItems = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const investorNavItems = [
|
const investorNavItems = [
|
||||||
{ label: 'Dashboard', href: '/investor', icon: Bike },
|
{ label: 'Dashboard', href: '/investor/dashboard', icon: Bike },
|
||||||
{ label: 'My Investments', href: '/investor/plans', icon: Target },
|
{ label: 'My Investments', href: '/investor/plans', icon: Target },
|
||||||
{ label: 'Rental History', href: '/investor/rental-history', icon: History },
|
{ label: 'Rental History', href: '/investor/rental-history', icon: History },
|
||||||
{ label: 'Withdraw', href: '/investor/withdraw', icon: CreditCard },
|
{ label: 'Withdraw', href: '/investor/withdraw', icon: CreditCard },
|
||||||
@@ -105,7 +105,7 @@ export default function Sidebar() {
|
|||||||
{ label: 'Fleet', href: '/admin/fleet', icon: Bike },
|
{ label: 'Fleet', href: '/admin/fleet', icon: Bike },
|
||||||
{ label: 'Users', href: '/admin/users', icon: Users },
|
{ label: 'Users', href: '/admin/users', icon: Users },
|
||||||
] : isInvestor ? [
|
] : isInvestor ? [
|
||||||
{ label: 'Home', href: '/investor', icon: Bike },
|
{ label: 'Home', href: '/investor/dashboard', icon: Bike },
|
||||||
{ label: 'Investments', href: '/investor/plans', icon: Target },
|
{ label: 'Investments', href: '/investor/plans', icon: Target },
|
||||||
{ label: 'History', href: '/investor/rental-history', icon: History },
|
{ label: 'History', href: '/investor/rental-history', icon: History },
|
||||||
{ label: 'Withdraw', href: '/investor/withdraw', icon: CreditCard },
|
{ 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">
|
<nav className="p-3 space-y-1 overflow-y-auto h-[calc(100vh-140px)] pb-24 lg:pb-3">
|
||||||
{navItems.map((item) => {
|
{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;
|
const Icon = item.icon;
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
@@ -200,7 +202,9 @@ export default function Sidebar() {
|
|||||||
{/* Bottom Navigation for Mobile */}
|
{/* 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)]">
|
<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) => {
|
{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;
|
const Icon = item.icon;
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
|
|||||||
Reference in New Issue
Block a user