diff --git a/apps/web/src/components/list-item/index.js b/apps/web/src/components/list-item/index.js index 4fb3ca44c..0713e727e 100644 --- a/apps/web/src/components/list-item/index.js +++ b/apps/web/src/components/list-item/index.js @@ -43,7 +43,7 @@ const ListItem = props => ( display={props.info ? "flex" : "none"} variant="body" fontSize={12} - color="primary" + color="foreground" > {props.info} diff --git a/apps/web/src/theme.js b/apps/web/src/theme.js index ee9a923b4..428b806e2 100644 --- a/apps/web/src/theme.js +++ b/apps/web/src/theme.js @@ -41,7 +41,7 @@ export default { fontSizes: { heading: 36, input: 16, - title: 22, + title: 18, subtitle: 18, body: 14, menu: 14 diff --git a/apps/web/src/views/Home.js b/apps/web/src/views/Home.js index 91219dc94..c9d47eb6c 100644 --- a/apps/web/src/views/Home.js +++ b/apps/web/src/views/Home.js @@ -1,18 +1,23 @@ import React, { useEffect, useState } from "react"; -import { Flex, Text } from "rebass"; +import { Flex, Text, Box } from "rebass"; import * as Icon from "react-feather"; import { db, ev, sendNewNoteEvent } from "../common"; -import { Virtuoso as List } from "react-virtuoso"; +import { GroupedVirtuoso as List } from "react-virtuoso"; import Button from "../components/button"; import Search from "../components/search"; import Note from "../components/note"; function Home() { - const [notes, setNotes] = useState(db.getNotes()); + const [notes, setNotes] = useState({ + items: [], + groupCounts: [], + groups: [] + }); useEffect(() => { function onRefreshNotes() { - setNotes(db.getNotes()); + setNotes(db.groupNotes(undefined, true)); } + onRefreshNotes(); ev.addListener("refreshNotes", onRefreshNotes); return () => { ev.removeListener("refreshNotes", onRefreshNotes); @@ -20,7 +25,7 @@ function Home() { }, []); return ( - {notes.length > 0 ? ( + {notes.items.length > 0 ? ( } + groupCounts={notes.groupCounts} + group={index => ( + + + {notes.groups[index].title} + + + )} + item={index => } />