From f641fb6f0d2ebff30329864bfd3b25c8e1428e7d Mon Sep 17 00:00:00 2001 From: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> Date: Tue, 10 May 2022 21:16:21 -0400 Subject: [PATCH] refactor: improve ui (#1) --- admin/src/components/NoteCreateModal/index.js | 18 +++++++-------- admin/src/components/NoteListItem/index.js | 22 ++++++++++++++----- .../components/NoteListLayoutContent/index.js | 5 ++++- .../components/NoteListLayoutFooter/index.js | 2 +- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/admin/src/components/NoteCreateModal/index.js b/admin/src/components/NoteCreateModal/index.js index 3565c9d..891a28e 100644 --- a/admin/src/components/NoteCreateModal/index.js +++ b/admin/src/components/NoteCreateModal/index.js @@ -12,10 +12,11 @@ import { Textarea } from '@strapi/design-system/Textarea'; import { Button } from '@strapi/design-system/Button'; import { Typography } from '@strapi/design-system/Typography'; import { Stack } from '@strapi/design-system/Stack'; +import Check from '@strapi/icons/Check'; import { requestPluginEndpoint } from '../../utils/requestPluginEndpoint'; const setInitialState = (note = {}) => ({ - ModalTitle: note.id ? 'Edit Note' : 'Create Note', + ModalTitle: note.id ? 'Edit a note' : 'Add a note', title: note.title || '', content: note.content || '', }); @@ -65,16 +66,11 @@ const NoteModalCreate = ({ toggleModal, note = {}, entity }) => { updateState('title', e.target.value)} defaultValue={values.title} /> - @@ -85,7 +81,11 @@ const NoteModalCreate = ({ toggleModal, note = {}, entity }) => { Cancel } - endActions={} + endActions={ + + } /> ); diff --git a/admin/src/components/NoteListItem/index.js b/admin/src/components/NoteListItem/index.js index 9fbe495..dc6b9df 100644 --- a/admin/src/components/NoteListItem/index.js +++ b/admin/src/components/NoteListItem/index.js @@ -34,14 +34,26 @@ const NoteListItem = ({ note, setActiveNote, toggleModal }) => { }; return ( - + - - {note.title} + + + {note.title} + - openNoteCreateModel(note)} label="Edit" icon={} /> - handleNoteDelete(note)} label="Delete" icon={} /> + openNoteCreateModel(note)} + label="Edit" + icon={} + /> + handleNoteDelete(note)} + label="Delete" + icon={} + /> diff --git a/admin/src/components/NoteListLayout/components/NoteListLayoutContent/index.js b/admin/src/components/NoteListLayout/components/NoteListLayoutContent/index.js index 3f428ec..11aaa45 100644 --- a/admin/src/components/NoteListLayout/components/NoteListLayoutContent/index.js +++ b/admin/src/components/NoteListLayout/components/NoteListLayoutContent/index.js @@ -28,7 +28,10 @@ const NoteListLayoutContent = ({ entity }) => { return ( - + {!query.isLoading && query.data.data.notes.map((n) => ( { return ( - } onClick={toggleModal}> + } onClick={toggleModal}> Add a note {isVisible && }