Working on refactoring to support router use case

This commit is contained in:
Max Lynch
2020-12-30 13:19:31 -06:00
parent 3fe67d30b3
commit 29ae24c6a6
11 changed files with 172 additions and 145 deletions
+1 -34
View File
@@ -7,32 +7,6 @@ import Lists from '../components/pages/Lists';
import Settings from '../components/pages/Settings';
import ListDetail from '../components/pages/ListDetail';
// The available pages here
const pages = [
{ id: 'home', title: 'Home', icon: homeOutline, selectedIcon: home, component: Home },
{
id: 'lists',
title: 'Lists',
icon: listOutline,
selectedIcon: list,
component: Lists,
},
{
id: 'list-detail',
title: () => Store.getRawState().selectedList?.name,
icon: listOutline,
selectedIcon: list,
component: ListDetail,
},
{
id: 'settings',
title: 'Settings',
icon: cogOutline,
selectedIcon: cog,
component: Settings,
},
];
export const images = [
'https://images.unsplash.com/photo-1608091526083-86ae8489ae5c?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=2100&q=80',
'https://images.unsplash.com/photo-1608050072262-7b26ba63fb46?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=2100&q=80',
@@ -91,14 +65,7 @@ const Store = new PullStateStore({
safeAreaBottom: 0,
menuOpen: false,
notificationsOpen: false,
currentPage: pages[0],
pages,
// The pages that are linked to tabs
tabs: pages.filter(p => ['home', 'lists', 'settings'].indexOf(p.id) >= 0),
// The pages that are linked to the menu
menuLinks: pages.filter(p => ['home', 'lists', 'settings'].indexOf(p.id) >= 0),
currentPage: null,
homeItems,
lists,
selectedList: null,