diff --git a/src/components/BottomNav.tsx b/src/components/BottomNav.tsx index 32b60e2..749cf66 100644 --- a/src/components/BottomNav.tsx +++ b/src/components/BottomNav.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { useAuth } from '@/context/AuthContext'; +import { useState } from 'react'; interface BottomNavProps { activeTab: 'home' | 'compose' | 'journal' | 'answered' | 'praying' | 'reflections' | 'about'; @@ -10,45 +11,109 @@ interface BottomNavProps { export default function BottomNav({ activeTab, onTabChange }: BottomNavProps) { const { logout, user } = useAuth(); + const [showMoreMenu, setShowMoreMenu] = useState(false); - const navItems = [ + const primaryNavItems = [ { id: 'home' as const, label: 'Home', icon: '🏠' }, { id: 'compose' as const, label: 'Compose', icon: 'âœī¸' }, { id: 'journal' as const, label: 'Journal', icon: '📅' }, { id: 'praying' as const, label: 'Praying', icon: '🙏' }, + ]; + + const moreMenuItems = [ { id: 'answered' as const, label: 'Answered', icon: '✅' }, { id: 'reflections' as const, label: 'Reflections', icon: '📖' }, { id: 'about' as const, label: 'About', icon: 'â„šī¸' }, ]; + const allNavItems = [...primaryNavItems, ...moreMenuItems]; + + const handleMoreClick = () => { + setShowMoreMenu(!showMoreMenu); + }; + + const handleMenuItemClick = (tab: typeof activeTab) => { + onTabChange(tab); + setShowMoreMenu(false); + }; + + const isMoreActive = moreMenuItems.some(item => item.id === activeTab); + return ( <> + {/* More Menu Modal */} + {showMoreMenu && ( + <> +
setShowMoreMenu(false)} + /> +
+ {moreMenuItems.map(item => ( + + ))} + +
+ + )} + {/* Mobile Bottom Navigation */} -