From 0f2cc6da352faf813cc2471300728577cf77f5e4 Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 16 Mar 2021 11:31:26 +0100 Subject: [PATCH] feat(phone): Doucment list component --- phone/src/apps/notes/list/DoucmentList.tsx | 37 ++++++++++++++++++++++ phone/src/apps/notes/list/NoteList.tsx | 6 ++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 phone/src/apps/notes/list/DoucmentList.tsx diff --git a/phone/src/apps/notes/list/DoucmentList.tsx b/phone/src/apps/notes/list/DoucmentList.tsx new file mode 100644 index 0000000..14c9710 --- /dev/null +++ b/phone/src/apps/notes/list/DoucmentList.tsx @@ -0,0 +1,37 @@ +import { List, ListItem, ListItemIcon, ListItemText } from '@material-ui/core'; +import React, { useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import NoteIcon from '@material-ui/icons/Note'; +import RecentActorsIcon from '@material-ui/icons/RecentActors'; +import { useHistory } from 'react-router'; + +export default function DoucmentList() { + const { t } = useTranslation(); + const history = useHistory(); + + const [list, setList] = useState([ + { + id: 1, + name: t('APPS_DOCUMENTS_NOTES_TITLE'), + icon: , + route: '/documents/notes', + }, + { + id: 2, + name: t('APPS_DOCUMENTS_LICENSE_TITLE'), + icon: , + route: '/documents/licenses', + }, + ]); + + return ( + + {list.map((l) => ( + history.push(l.route)}> + {l.icon} + + + ))} + + ); +} diff --git a/phone/src/apps/notes/list/NoteList.tsx b/phone/src/apps/notes/list/NoteList.tsx index 088cc40..571b0cd 100644 --- a/phone/src/apps/notes/list/NoteList.tsx +++ b/phone/src/apps/notes/list/NoteList.tsx @@ -3,6 +3,7 @@ import { List, ListItem, ListItemText } from '@material-ui/core'; import { useNoteDetail } from '../hooks/useNoteDetail'; import { useNotes } from '../hooks/useNotes'; import { useHistory } from 'react-router-dom'; +import useStyles from '../notes.styles'; // add search bar later // TODO: Add interface for note @@ -10,17 +11,18 @@ const NoteList = () => { const history = useHistory(); const { notes } = useNotes(); const { setDetail } = useNoteDetail(); + const classes = useStyles(); const handleNoteModal = (note) => { setDetail(note); - history.push('/notes/detail'); + history.push('/documents/notes/detail'); }; return ( {notes.map((note) => ( handleNoteModal(note)}> - {note.title} + ))}