import { useCallback, useState } from 'react'; import App from '../components/App'; import Backdrop from '../components/Backdrop'; import Menu from '../components/Menu'; import Modal from '../components/Modal'; import Nav from '../components/Nav'; import Home from '../components/pages/Home'; import Profile from '../components/pages/Profile'; import Settings from '../components/pages/Settings'; import Tab from '../components/Tab'; import TabBar from '../components/TabBar'; import Store from '../store'; const pages = [ { id: 'home', title: 'Home', icon: 'home-outline', selectedIcon: 'home', component: Home }, { id: 'profile', title: 'Profile', icon: 'person-outline', selectedIcon: 'person', component: Profile, }, { id: 'settings', title: 'Settings', icon: 'cog-outline', selectedIcon: 'cog', component: Settings, }, ]; const CurrentPage = ({ page }) => { return (
{pages.map(p => { const Page = p.component; return ; })}
); }; const MenuItem = ({ children }) => (
  • {children}
  • ); const MenuContent = () => ( <>

    Menu

    ); const NotificationsContent = () => (

    Notifications

    ); export default function Index() { const [page, setPage] = useState(pages[0]); const showMenu = Store.useState(s => s.showMenu); const showNotifications = Store.useState(s => s.showNotifications); const openMenu = () => { Store.update(s => { s.showMenu = true; }); }; const closeMenu = () => { Store.update(s => { s.showMenu = false; }); }; const backdropClose = () => { Store.update(s => { s.showMenu = false; s.showNotifications = false; }); }; const closeNotifications = () => { Store.update(s => { s.showNotifications = false; }); }; return (