From c1db9727c7135c5f5e10e7e13837a3e57cea1aaf Mon Sep 17 00:00:00 2001 From: Yves Gugger Date: Sat, 13 Dec 2025 13:19:54 +0100 Subject: [PATCH] Mobile: Beautiful slide-in navigation drawer --- frontend/src/app/terminal/radar/page.tsx | 200 ++++++++++++++++++++++- 1 file changed, 196 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/terminal/radar/page.tsx b/frontend/src/app/terminal/radar/page.tsx index 1dffefe..f375dac 100644 --- a/frontend/src/app/terminal/radar/page.tsx +++ b/frontend/src/app/terminal/radar/page.tsx @@ -25,7 +25,14 @@ import { ChevronRight, Sparkles, Radio, - Activity + Activity, + Menu, + Tag, + Coins, + Shield, + LogOut, + Crown, + ChevronDown } from 'lucide-react' import clsx from 'clsx' import Link from 'next/link' @@ -59,7 +66,7 @@ interface SearchResult { // ============================================================================ export default function RadarPage() { - const { isAuthenticated, domains, addDomain } = useStore() + const { isAuthenticated, domains, addDomain, user, subscription, logout } = useStore() const { toast, showToast, hideToast } = useToast() const [hotAuctions, setHotAuctions] = useState([]) @@ -71,6 +78,9 @@ export default function RadarPage() { const [addingToWatchlist, setAddingToWatchlist] = useState(false) const [searchFocused, setSearchFocused] = useState(false) const searchInputRef = useRef(null) + + // Mobile Menu State + const [menuOpen, setMenuOpen] = useState(false) // Load Data const loadDashboardData = useCallback(async () => { @@ -147,13 +157,41 @@ export default function RadarPage() { const availableDomains = domains?.filter(d => d.is_available) || [] const totalDomains = domains?.length || 0 - // Nav Items for Mobile + // Nav Items for Mobile Bottom Bar const mobileNavItems = [ { href: '/terminal/radar', label: 'Radar', icon: Target, active: true }, { href: '/terminal/market', label: 'Market', icon: Gavel, active: false }, { href: '/terminal/watchlist', label: 'Watch', icon: Eye, active: false }, { href: '/terminal/intel', label: 'Intel', icon: TrendingUp, active: false }, - { href: '/terminal/settings', label: 'More', icon: Settings, active: false }, + ] + + // Full Navigation for Drawer + const tierName = subscription?.tier_name || subscription?.tier || 'Scout' + const TierIcon = tierName === 'Tycoon' ? Crown : tierName === 'Trader' ? TrendingUp : Zap + + const drawerNavSections = [ + { + title: 'Discover', + items: [ + { href: '/terminal/radar', label: 'Radar', icon: Target }, + { href: '/terminal/market', label: 'Market', icon: Gavel }, + { href: '/terminal/intel', label: 'Intel', icon: TrendingUp }, + ] + }, + { + title: 'Manage', + items: [ + { href: '/terminal/watchlist', label: 'Watchlist', icon: Eye }, + { href: '/terminal/sniper', label: 'Sniper', icon: Target }, + ] + }, + { + title: 'Monetize', + items: [ + { href: '/terminal/yield', label: 'Yield', icon: Coins, isNew: true }, + { href: '/terminal/listing', label: 'For Sale', icon: Tag }, + ] + } ] return ( @@ -521,8 +559,162 @@ export default function RadarPage() { {item.label} ))} + + {/* Menu Button */} + + + {/* ═══════════════════════════════════════════════════════════════════════ */} + {/* MOBILE DRAWER MENU */} + {/* ═══════════════════════════════════════════════════════════════════════ */} + {menuOpen && ( +
+ {/* Backdrop */} +
setMenuOpen(false)} + /> + + {/* Drawer Panel */} +
+ + {/* Drawer Header */} +
+
+ Pounce +
+

Pounce

+

Terminal

+
+
+ +
+ + {/* Navigation Sections */} +
+ {drawerNavSections.map((section) => ( +
+
+
+ {section.title} +
+
+ {section.items.map((item: any) => ( + setMenuOpen(false)} + className="flex items-center gap-3 px-5 py-3 text-white/60 hover:text-white hover:bg-white/[0.03] active:bg-white/[0.05] transition-colors" + > + + {item.label} + {item.isNew && ( + + New + + )} + + + ))} +
+
+ ))} + + {/* Settings */} +
+ setMenuOpen(false)} + className="flex items-center gap-3 px-5 py-3 text-white/60 hover:text-white hover:bg-white/[0.03] active:bg-white/[0.05] transition-colors" + > + + Settings + + + + {user?.is_admin && ( + setMenuOpen(false)} + className="flex items-center gap-3 px-5 py-3 text-amber-500/70 hover:text-amber-400 hover:bg-amber-500/5 active:bg-amber-500/10 transition-colors" + > + + Admin Panel + + + )} +
+
+ + {/* User Card */} +
+
+
+ +
+
+

+ {user?.name || user?.email?.split('@')[0] || 'User'} +

+

+ {tierName} +

+
+
+ + {/* Usage Bar */} +
+
+ Usage + {subscription?.domains_used || 0}/{subscription?.domain_limit || 5} +
+
+
+
+
+ + {tierName === 'Scout' && ( + setMenuOpen(false)} + className="flex items-center justify-center gap-2 w-full py-3 bg-accent text-black text-sm font-bold hover:bg-white active:scale-[0.98] transition-all mb-3" + > + + Upgrade Plan + + )} + + +
+
+
+ )} {/* Toast */}