From ba784683d49cd5c00f3783f291aa05d3aa39fc86 Mon Sep 17 00:00:00 2001 From: pancakes Date: Wed, 26 Feb 2025 00:27:29 +1000 Subject: [PATCH] [frontend/components] Add copy contents button to note footer menu --- Iceshrimp.Frontend/Components/Note/NoteFooter.razor | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Iceshrimp.Frontend/Components/Note/NoteFooter.razor b/Iceshrimp.Frontend/Components/Note/NoteFooter.razor index 3b3de503..cc8efaba 100644 --- a/Iceshrimp.Frontend/Components/Note/NoteFooter.razor +++ b/Iceshrimp.Frontend/Components/Note/NoteFooter.razor @@ -109,6 +109,12 @@ @Loc["Copy link (remote)"] } + @if (!string.IsNullOrWhiteSpace(Note.Text)) + { + + @Loc["Copy contents"] + + } @if (Note.User.Id == Session.Current?.Id) {
@@ -151,9 +157,11 @@ var instance = await MetadataSvc.Instance.Value; await Js.InvokeVoidAsync("navigator.clipboard.writeText", $"https://{instance.WebDomain}/notes/{Note.Id}"); } - + private void CopyLinkRemote() => Js.InvokeVoidAsync("navigator.clipboard.writeText", Note.Url); + private void CopyContents() => Js.InvokeVoidAsync("navigator.clipboard.writeText", Note.Text); + private void Like() { _ = NoteActions.ToggleLikeAsync(Note);