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
+3 -11
View File
@@ -14,8 +14,6 @@ const MenuItem = ({ children, ...props }) => (
);
const MenuContent = () => {
const menuLinks = Store.useState(selectors.getMenuLinks);
const go = page => {
actions.setPage(page);
actions.setMenuOpen(false);
@@ -27,15 +25,9 @@ const MenuContent = () => {
<h2 className="text-xl select-none dark:text-gray-500">Menu</h2>
</div>
<ul>
{menuLinks.map(p => {
const title = typeof p.title === 'function' ? p.title() : p.title;
return (
<MenuItem key={p.id} onClick={() => go(p)}>
{title}
</MenuItem>
);
})}
<MenuItem onClick={() => {}}>Home</MenuItem>
<MenuItem onClick={() => {}}>Lists</MenuItem>
<MenuItem onClick={() => {}}>Settings</MenuItem>
</ul>
</>
);