From 569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a Mon Sep 17 00:00:00 2001 From: piotrruss Date: Mon, 6 Sep 2021 23:13:22 +0200 Subject: added stadard linter --- apps/Notes/components/List.js | 96 ++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 46 deletions(-) (limited to 'apps/Notes/components/List.js') diff --git a/apps/Notes/components/List.js b/apps/Notes/components/List.js index 238e305..05d0711 100644 --- a/apps/Notes/components/List.js +++ b/apps/Notes/components/List.js @@ -1,24 +1,24 @@ import styles from '../styles/Notes.module.scss' -import React, {useState, useEffect} from 'react' +import React, { useState, useEffect } from 'react' import useUser from 'hooks/useUser' import useSettings from 'hooks/useSettings' import useNotes from '../hooks/useNotes' import useSort from '../hooks/useSort' import ListItem from './ListItem' import Actions from './Actions' -import {Splash} from 'components' +import { Splash } from 'components' const List = () => { const [fetchedNote, setFetchedNote] = useState() const [action, setAction] = useState('') const [loading, setLoading] = useState(false) const [showSort, setShowSort] = useState(false) - const {notes, error} = useNotes() + const { notes, error } = useNotes() const [sortedBy, sortBy, sortFn] = useSort(3) - const {t} = useSettings() - const {user} = useUser({ + const { t } = useSettings() + const { user } = useUser({ redirectToLogin: true, - redirectToVerify: true, + redirectToVerify: true }) useEffect(() => { @@ -32,33 +32,34 @@ const List = () => { } return ( - action === '' ? ( - <> -
-
-
setAction('addNote')}>{t('notes_new')}
-
{setShowSort(s => !s)}}>{t('sort')}
-
setAction('importNotes')}>{t('import')}
-
setAction('exportNotes')}>{t('export')}
+ action === '' + ? ( + <> +
+
+
setAction('addNote')}>{t('notes_new')}
+
{ setShowSort(s => !s) }}>{t('sort')}
+
setAction('importNotes')}>{t('import')}
+
setAction('exportNotes')}>{t('export')}
+
-
-
- - - - - - - - - - - - - - - - { +
+
{t('sort_by')}
sortBy(1)}>{t('title')} {sortedBy(1)} sortBy(2)}>{t('created')} {sortedBy(2)} sortBy(3)}>{t('modified')} {sortedBy(3)}
setShowSort(false)}>{t('close')}
+ + + + + + + + + + + + + + + { notes.length > 0 ? (notes.sort(sortFn).map(note => ( { setFetchedNote={setFetchedNote} setLoading={setLoading} /> - ))) : ( + ))) + : ( - )} - -
{t('sort_by')}
sortBy(1)}>{t('title')} {sortedBy(1)} sortBy(2)}>{t('created')} {sortedBy(2)} sortBy(3)}>{t('modified')} {sortedBy(3)}
setShowSort(false)}>{t('close')}
{t('notes_list_empty')}
-
- - ) : ( - - ) + ) +} + + +
+ + ) + : ( + + ) ) } -- cgit v1.2.3