[frontend/components] Add open about page button to note and profile menus

This commit is contained in:
pancakes 2025-03-29 15:54:49 +10:00
parent 46d86fd960
commit f9fb6194c7
No known key found for this signature in database
2 changed files with 14 additions and 0 deletions

View file

@ -9,6 +9,7 @@
@inject SessionService Session;
@inject GlobalComponentSvc GlobalComponentSvc
@inject MetadataService MetadataSvc;
@inject NavigationManager Nav;
@inject NoteActions NoteActions;
<div class="note-footer">
@ -103,6 +104,9 @@
<Text>@Loc["Mute thread"]</Text>
</MenuElement>
<hr class="rule"/>
<MenuElement Icon="Icons.Info" OnSelect="OpenAbout">
<Text>@Loc["About"]</Text>
</MenuElement>
<MenuElement Icon="Icons.ArrowSquareOut" OnSelect="OpenOriginal">
<Text>@Loc["Open original page"]</Text>
</MenuElement>
@ -156,6 +160,8 @@
private void Delete() => _ = NoteActions.DeleteAsync(Note);
private void OpenAbout() => Nav.NavigateTo($"/notes/{Note.Id}/about");
private void OpenOriginal() => Js.InvokeVoidAsync("open", Note.Url, "_blank");
private async Task CopyLink()

View file

@ -81,6 +81,9 @@
</MenuElement>
}
<hr class="rule"/>
<MenuElement Icon="Icons.Info" OnSelect="OpenAbout">
<Text>@Loc["About"]</Text>
</MenuElement>
@if (UserResponse.Host != null && Profile?.Url != null)
{
<MenuElement Icon="Icons.ArrowSquareOut" OnSelect="OpenOriginal">
@ -396,6 +399,11 @@
}
}
private void OpenAbout()
{
Nav.NavigateTo($"{Nav.Uri}/about");
}
private void OpenOriginal()
{
if (Profile?.Url != null)