aboutsummaryrefslogtreecommitdiffstats
path: root/apps/Notes/components/ListItem.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/Notes/components/ListItem.js')
-rw-r--r--apps/Notes/components/ListItem.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/Notes/components/ListItem.js b/apps/Notes/components/ListItem.js
index 0e34ffc..4a404db 100644
--- a/apps/Notes/components/ListItem.js
+++ b/apps/Notes/components/ListItem.js
@@ -1,10 +1,10 @@
import styles from '../Notes.module.scss'
-import React, { useContext } from 'react'
+import React from 'react'
import {getNote, exportNote, removeNote} from '../helpers/noteActions.js'
import useNotes from '../hooks/useNotes'
-import Context from 'context';
-import { faEdit, faDownload, faTrash } from '@fortawesome/free-solid-svg-icons'
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
+import usePopup from 'hooks/usePopup'
+import {faEdit, faDownload, faTrash } from '@fortawesome/free-solid-svg-icons'
+import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
const datestring = date => {
const d = new Date(date);
@@ -13,8 +13,8 @@ const datestring = date => {
};
const ListItem = ({note, setAction, setFetchedNote, setLoading}) => {
+ const {setPopup} = usePopup()
const {mutateNotes} = useNotes()
- const {setPopup} = useContext(Context)
const handleNoteAction = async (a, note, e) => {
if (e) e.stopPropagation()
@@ -28,8 +28,7 @@ const ListItem = ({note, setAction, setFetchedNote, setLoading}) => {
key={note._id}
onClick={() => handleNoteAction('showNote', note)}
>
- <td
- >
+ <td>
<span>{`${note.title}`}</span>
<span onClick={e => handleNoteAction('editNote', note, e)}>
<FontAwesomeIcon icon={faEdit} />