diff options
Diffstat (limited to 'apps/Notes/hooks')
-rw-r--r-- | apps/Notes/hooks/useNotes.js | 4 | ||||
-rw-r--r-- | apps/Notes/hooks/useSort.js | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/apps/Notes/hooks/useNotes.js b/apps/Notes/hooks/useNotes.js index 586ceeb..d02be10 100644 --- a/apps/Notes/hooks/useNotes.js +++ b/apps/Notes/hooks/useNotes.js @@ -1,7 +1,7 @@ import useSWR from 'swr' -export default function useNotes(){ +export default function useNotes () { const { data: notes, error, mutate: mutateNotes } = useSWR('/api/notes') - return {notes, mutateNotes, error} + return { notes, mutateNotes, error } } diff --git a/apps/Notes/hooks/useSort.js b/apps/Notes/hooks/useSort.js index 78c01b4..e3cf230 100644 --- a/apps/Notes/hooks/useSort.js +++ b/apps/Notes/hooks/useSort.js @@ -1,12 +1,12 @@ -import {useState} from 'react' -import {faSortAmountDown, faSortAmountUp} from '@fortawesome/free-solid-svg-icons' -import {FontAwesomeIcon} from '@fortawesome/react-fontawesome' +import { useState } from 'react' +import { faSortAmountDown, faSortAmountUp } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' const useSort = (d) => { const [sort, setSort] = useState(d) - const sortedBy = s => Math.abs(sort) === s && <FontAwesomeIcon icon={sort>0 ? faSortAmountDown : faSortAmountUp} /> - const sortBy = s => sort === s ? setSort(-1*s) : setSort(s) + const sortedBy = s => Math.abs(sort) === s && <FontAwesomeIcon icon={sort > 0 ? faSortAmountDown : faSortAmountUp} /> + const sortBy = s => sort === s ? setSort(-1 * s) : setSort(s) const sortFn = (a, b) => { const d = sort > 0 ? 1 : -1 switch (Math.abs(sort)) { |