From 19d9d34f35b00fcb4dccb4672b078ab3f747df60 Mon Sep 17 00:00:00 2001 From: Quentin Guillemin Date: Tue, 18 Apr 2023 16:04:31 +0200 Subject: [PATCH] feat: add ability to focus actions --- client/src/assets/scss/editor.scss | 24 ++++++++++--- client/src/components/Editor.tsx | 54 +++++++++++++++++------------- 2 files changed, 50 insertions(+), 28 deletions(-) diff --git a/client/src/assets/scss/editor.scss b/client/src/assets/scss/editor.scss index fc4a848..b878687 100644 --- a/client/src/assets/scss/editor.scss +++ b/client/src/assets/scss/editor.scss @@ -13,12 +13,14 @@ tldraw-editor { border-bottom-left-radius: $border-radius; background-color: var(--colors-panel); border: 1px solid var(--colors-panelContrast); + border-top: 0px; div { display: flex; } - .sharing-item { + button.sharing-item, + input.sharing-item { width: fit-content; min-width: $height; height: $height; @@ -31,10 +33,13 @@ tldraw-editor { font-size: var(--fontSizes-1); font-family: var(--fonts-ui); color: var(--colors-text); + background: none; + outline: none; + border: 1px solid var(--colors-panel); user-select: none; } - a.sharing-item-enabled { + button.sharing-item-enabled { width: fit-content; min-width: $height; height: $height; @@ -48,19 +53,28 @@ tldraw-editor { font-family: var(--fonts-ui); color: white; background-color: var(--colors-selected); + outline: none; + border: 1px solid var(--colors-panel); user-select: none; } input.input-join { - border: none; - outline: none; width: 280px; text-align: center; + outline: none; + border: 1px solid var(--colors-panel); } - .sharing-item:hover, + button.sharing-item:hover, + input.sharing-item:hover, + button.sharing-item:focus, input.input-join:focus { background-color: var(--colors-hover); } + + button.sharing-item-enabled:focus { + color: var(--colors-selected); + background-color: var(--colors-hover); + } } } diff --git a/client/src/components/Editor.tsx b/client/src/components/Editor.tsx index 06acd19..dda5f48 100644 --- a/client/src/components/Editor.tsx +++ b/client/src/components/Editor.tsx @@ -128,27 +128,30 @@ function Editor({
{nextcloudUrl && !nextcloudSaveHide && userApi && !wantJoinRoom && ( - setSaveOnNextcloudState(!saveOnNextcloudState)} title={t("sharingItem.nextcloudSave") as string} > - + )} {wsUrl && !room && (
{!noShare && !readOnly && !wantJoinRoom && ( - setRoom(uuidv4())} title={t("sharingItem.generateRoom") as string} > - + )} {!noShare && !readOnly && !wantJoinRoom && ( - { setUseLocalDoc(true); @@ -157,16 +160,27 @@ function Editor({ title={t("sharingItem.shareCurrentPage") as string} > - + )} {!noJoin && !wantJoinRoom && ( - setWantJoinRoom(true)} title={t("sharingItem.joinRoom") as string} > - + + )} + {!noJoin && wantJoinRoom && ( + )} {!noJoin && wantJoinRoom && ( )} - {!noJoin && wantJoinRoom && ( - - - - )} {!noJoin && joinRoom && uuidValidate(joinRoom) && ( - - + )}
)} {wsUrl && room && (
{!noShare && ( - navigator.clipboard.writeText(room)} title={t("sharingItem.roomId") as string} > {room} - + )} {!noLeave && ( - - + )}
)}