import { useState } from 'react'; import { Virtuoso } from 'react-virtuoso'; import { flash, flashOutline, cog, cogOutline, home, homeOutline } from 'ionicons/icons'; 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'; import { useDrag } from 'react-use-gesture'; const pages = [ { id: 'home', title: 'Home', icon: homeOutline, selectedIcon: home, component: Home }, { id: 'feed', title: 'Feed', icon: flashOutline, selectedIcon: flash, component: Feed, }, { id: 'settings', title: 'Settings', icon: cogOutline, 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; }); }; const bind = useDrag( ({ down, movement: [mx] }) => { console.log('DRAGGING SIDE', mx); }, { axis: 'x', } ); // This is an example app layout. We've got a hidden menu that will be toggled // return (