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
+10 -1
View File
@@ -3,6 +3,8 @@ import Card from '../ui/Card';
import Content from '../ui/Content';
import * as selectors from '../../store/selectors';
import usePage from '../../hooks/usePage';
import { home, homeOutline } from 'ionicons/icons';
const HomeCard = ({ title, type, text, author, image }) => (
<Card className="my-4">
@@ -18,10 +20,17 @@ const HomeCard = ({ title, type, text, author, image }) => (
);
const Home = ({ selected }) => {
usePage({
id: 'home',
title: 'Home',
icon: homeOutline,
selectedIcon: home,
});
const homeItems = Store.useState(selectors.getHomeItems);
return (
<Content visible={selected} className="p-4 dark:bg-black">
<Content visible={true} className="p-4 dark:bg-black">
{homeItems.map((i, index) => (
<HomeCard {...i} key={index} />
))}