diff options
author | 2021-09-30 22:48:13 +0200 | |
---|---|---|
committer | 2021-10-01 00:53:11 +0200 | |
commit | 79bdb88a5fc099b5871a83d18eadf9b0448b41d1 (patch) | |
tree | d0a8e48dda7649205e08d17c2fa0de938e27a674 /apps/Notes/components/Export.js | |
parent | cf1fbb69d7cdb67219be187fc38feea5a6325f45 (diff) | |
download | my_apps-79bdb88a5fc099b5871a83d18eadf9b0448b41d1.tar.gz my_apps-79bdb88a5fc099b5871a83d18eadf9b0448b41d1.tar.bz2 my_apps-79bdb88a5fc099b5871a83d18eadf9b0448b41d1.zip |
added favicons & notes route for phone
Diffstat (limited to 'apps/Notes/components/Export.js')
-rw-r--r-- | apps/Notes/components/Export.js | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/apps/Notes/components/Export.js b/apps/Notes/components/Export.js index 4ab1d64..516c0ec 100644 --- a/apps/Notes/components/Export.js +++ b/apps/Notes/components/Export.js @@ -3,6 +3,8 @@ import React, { useState } from 'react' import useSettings from 'hooks/useSettings' import useNotes from '../hooks/useNotes' import { handleSelect, handleSelectAll, handleExport } from '../helpers/export' +import { faCheck, faTimes } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' const Export = ({ setAction }) => { const { notes } = useNotes() @@ -29,29 +31,43 @@ const Export = ({ setAction }) => { /> <p>{t('notes_to_export')}</p> <div className={styles.export__select}> - <input - type='checkbox' - name='selectAll' - onChange={e => handleSelectAll(e, notes, setIds)} - checked={notes.length === ids.length} - /> - <label htmlFor='selectAll'>{t('select_all')}</label> + <label> + <input + type='checkbox' + name='selectAll' + onChange={e => handleSelectAll(e, notes, setIds)} + checked={notes.length === ids.length} + className='hidden' + /> + <span style={{ color: notes.length === ids.length ? 'green' : 'brown' }}> + <FontAwesomeIcon icon={notes.length === ids.length ? faCheck : faTimes} /> + </span> + {t('select_all')} + </label> </div> <ul> - {notes.sort(sortFn).map(note => ( - <li key={note.noteId}> - <input - type='checkbox' - name={note.noteId} - value={note.noteId} - checked={ids.includes(note.noteId)} - onChange={() => handleSelect(note.noteId, ids, setIds)} - /> - <label htlmfor={note.noteId}> - {note.title} - </label><br /> - </li> - ))} + {notes.sort(sortFn).map(note => { + const checked = ids.includes(note.noteId) + + return ( + <li key={note.noteId}> + <label> + <input + type='checkbox' + name={note.noteId} + value={note.noteId} + checked={ids.includes(note.noteId)} + onChange={() => handleSelect(note.noteId, ids, setIds)} + className='hidden' + /> + <span style={{ color: checked ? 'green' : 'brown' }}> + <FontAwesomeIcon icon={checked ? faCheck : faTimes} /> + </span> + {note.title} + </label> + </li> + ) + })} </ul> </div> </section> |