From 66bdd7e06ff8e6ff7e292439199dae6eb044f684 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Tue, 26 Apr 2022 23:15:49 +0300 Subject: [PATCH] frontend: add message edit overlay --- frontend/src/components/Message.svelte | 22 +++++++ .../components/overlays/EditMessage.svelte | 65 +++++++++++++++++++ .../overlays/OverlayProvider.svelte | 4 ++ src/routes/api/v1/messages.ts | 3 +- 4 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 frontend/src/components/overlays/EditMessage.svelte diff --git a/frontend/src/components/Message.svelte b/frontend/src/components/Message.svelte index e107504..6398795 100644 --- a/frontend/src/components/Message.svelte +++ b/frontend/src/components/Message.svelte @@ -1,4 +1,7 @@ @@ -8,6 +11,18 @@ word-break: break-all; } + .message .edit-message { + visibility: hidden; + } + + .message:hover { + background-color: var(--background-color-2); + } + + .message:hover .edit-message { + visibility: visible; + } + .message-content { color: var(--foreground-color-2); } @@ -20,9 +35,16 @@ font-weight: bold; margin-right: var(--space-xxs); } + + .edit-message { + float: right; + }
diff --git a/frontend/src/components/overlays/EditMessage.svelte b/frontend/src/components/overlays/EditMessage.svelte new file mode 100644 index 0000000..ffa3f62 --- /dev/null +++ b/frontend/src/components/overlays/EditMessage.svelte @@ -0,0 +1,65 @@ + + + + +