From b1194e959d10fb090700cd1ac4032bf7c530dc88 Mon Sep 17 00:00:00 2001 From: ELKorede <157540453+ELKorede@users.noreply.github.com> Date: Sun, 30 Aug 2026 22:00:40 +0000 Subject: [PATCH 1/2] feat: add fixed mobile bottom navigation bar - Add MobileBottomNav component with four tabs (Marketplace, Portfolio, Watchlist, Notifications), visible only on viewports below 768px via md:hidden - Active tab highlighted per current route with top-edge indicator bar - Notification badge on the Notifications tab reads unreadCount from useNotifications, capped at 99+ - Add RootLayout wrapper using so MobileBottomNav is mounted globally inside the router context without per-page changes - Nest all routes under RootLayout in routes.tsx - Document the hidden md:flex intent on Header nav links to make it explicit that MobileBottomNav covers mobile navigation --- src/components/common/MobileBottomNav.tsx | 127 ++++++++++++++++++++++ src/components/common/RootLayout.tsx | 19 ++++ src/components/home/Header.tsx | 4 +- src/routes.tsx | 98 +++++++++-------- 4 files changed, 201 insertions(+), 47 deletions(-) create mode 100644 src/components/common/MobileBottomNav.tsx create mode 100644 src/components/common/RootLayout.tsx diff --git a/src/components/common/MobileBottomNav.tsx b/src/components/common/MobileBottomNav.tsx new file mode 100644 index 00000000..8aae9751 --- /dev/null +++ b/src/components/common/MobileBottomNav.tsx @@ -0,0 +1,127 @@ +import { LayoutGrid, BarChart2, Bookmark, Bell } from 'lucide-react'; +import { NavLink, useLocation } from 'react-router'; +import { cn } from '@/lib/utils'; +import { useNotifications } from '@/hooks/useNotifications'; +import { useProfileStore } from '@/hooks/useProfileStore'; + +interface Tab { + label: string; + href: string; + /** Additional paths that should also highlight this tab as active. */ + matchPaths?: string[]; + icon: React.ReactNode; + activeIcon?: React.ReactNode; +} + +const tabs: Tab[] = [ + { + label: 'Marketplace', + href: '/', + matchPaths: ['/creators'], + icon: