From 6eb3e82516f86e8cce34105fce5c36596c104a04 Mon Sep 17 00:00:00 2001 From: sylenien Date: Thu, 6 Oct 2022 09:54:30 +0200 Subject: [PATCH] fix(ui): minor note fixes --- .../Player/Controls/components/CreateNote.tsx | 19 ++++++--- .../Session_/components/NotePopup.tsx | 41 +++++++++++++------ frontend/app/components/ui/SVG.tsx | 3 +- frontend/app/services/NotesService.ts | 2 +- frontend/app/svg/icons/check-circle-fill.svg | 3 ++ 5 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 frontend/app/svg/icons/check-circle-fill.svg diff --git a/frontend/app/components/Session_/Player/Controls/components/CreateNote.tsx b/frontend/app/components/Session_/Player/Controls/components/CreateNote.tsx index 5b21d2b4c..e85347590 100644 --- a/frontend/app/components/Session_/Player/Controls/components/CreateNote.tsx +++ b/frontend/app/components/Session_/Player/Controls/components/CreateNote.tsx @@ -32,9 +32,9 @@ function CreateNote({ }: Props) { const [text, setText] = React.useState(''); const [isPublic, setPublic] = React.useState(false); - const [tag, setTag] = React.useState(); + const [tag, setTag] = React.useState(TAGS[0]); const [useTimestamp, setUseTs] = React.useState(true); - + const inputRef = React.createRef() const { notesStore } = useStore(); React.useEffect(() => { @@ -48,6 +48,12 @@ function CreateNote({ } }, [isEdit]); + React.useEffect(() => { + if (inputRef.current) { + inputRef.current.focus() + } + }, [isVisible]) + const duration = Duration.fromMillis(time).toFormat('mm:ss'); const stopEvents = (e: any) => { e.stopPropagation(); @@ -138,6 +144,7 @@ function CreateNote({