import { useState } from 'react'; import { Virtuoso } from 'react-virtuoso'; import Store from '../store'; import App from '../components/ui/App'; import Backdrop from '../components/ui/Backdrop'; import Menu from '../components/ui/Menu'; import Modal from '../components/ui/Modal'; import Nav from '../components/ui/Nav'; import Tab from '../components/ui/Tab'; import TabBar from '../components/ui/TabBar'; import List from '../components/ui/List'; import ListItem from '../components/ui/ListItem'; import Button from '../components/ui/Button'; import { SafeAreaProvider } from '../components/ui/SafeArea'; import Home from '../components/pages/Home'; import Feed from '../components/pages/Feed'; import Settings from '../components/pages/Settings'; const pages = [ { id: 'home', title: 'Home', icon: 'home-outline', selectedIcon: 'home', component: Home }, { id: 'feed', title: 'Feed', icon: 'flash-outline', selectedIcon: 'person', component: Feed, }, { 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 FakeNotification = ({ i }) => ( Notification
    You have a new friend request
    ); 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 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; }); }; // This is an example app layout. We've got a hidden menu that will be toggled // return (