Routing
This commit is contained in:
@@ -42,6 +42,10 @@ const ListItemEntry = ({ list, item }) => (
|
||||
const ListDetail = ({ selected }) => {
|
||||
const selectedList = Store.useState(selectors.getSelectedList);
|
||||
|
||||
usePage({
|
||||
title: selectedList.title,
|
||||
});
|
||||
|
||||
return (
|
||||
<Content visible={selected} className="p-4">
|
||||
<List className="h-full w-full">
|
||||
@@ -49,8 +53,10 @@ const ListDetail = ({ selected }) => {
|
||||
<ListItems
|
||||
list={selectedList}
|
||||
onClose={() => {
|
||||
/*
|
||||
actions.setSelectedList(null);
|
||||
actions.setPageById('lists');
|
||||
*/
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import usePage from '../../hooks/usePage';
|
||||
import Store from '../../store';
|
||||
import * as actions from '../../store/actions';
|
||||
import * as selectors from '../../store/selectors';
|
||||
@@ -31,17 +32,23 @@ const AllLists = ({ onSelect }) => {
|
||||
};
|
||||
|
||||
const Lists = ({ selected }) => {
|
||||
usePage({
|
||||
title: 'Lists',
|
||||
});
|
||||
|
||||
return (
|
||||
<Content visible={true} className="p-4 dark:bg-black">
|
||||
<List className="h-full w-full">
|
||||
{selected && (
|
||||
<AllLists
|
||||
onSelect={list => {
|
||||
actions.setSelectedList(list);
|
||||
actions.setPageById('list-detail');
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{/*selected && (*/}
|
||||
<AllLists
|
||||
onSelect={list => {
|
||||
/*
|
||||
actions.setSelectedList(list);
|
||||
actions.setPageById('list-detail');
|
||||
*/
|
||||
}}
|
||||
/>
|
||||
{/*)}*/}
|
||||
</List>
|
||||
</Content>
|
||||
);
|
||||
|
||||
@@ -6,8 +6,13 @@ import Content from '../ui/Content';
|
||||
import List from '../ui/List';
|
||||
import ListItem from '../ui/ListItem';
|
||||
import Toggle from '../ui/Toggle';
|
||||
import usePage from '../../hooks/usePage';
|
||||
|
||||
const Settings = ({ selected }) => {
|
||||
usePage({
|
||||
title: 'Settings',
|
||||
});
|
||||
|
||||
const enableNotifications = Store.useState();
|
||||
const settings = Store.useState(selectors.getSettings);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user