[frontend] Add bite button to note's more menu

This commit is contained in:
pancakes 2024-10-19 16:30:25 +10:00 committed by Iceshrimp development
parent d546cc8733
commit ed81306ef1
3 changed files with 14 additions and 0 deletions

View file

@ -166,6 +166,11 @@ public partial class Note : IDisposable
ComposeService.ComposeDialog?.OpenDialogRedraft(NoteResponse);
}
public async void Bite()
{
await ApiService.Notes.BiteNote(NoteResponse.Id);
}
public async void Mute()
{
await ApiService.Notes.MuteNote(NoteResponse.Id);

View file

@ -82,6 +82,12 @@
<Text>@Loc["Redraft"]</Text>
</MenuElement>
}
else
{
<MenuElement Icon="Icons.Tooth" OnSelect="Note.Bite">
<Text>@Loc["Bite"]</Text>
</MenuElement>
}
<MenuElement Icon="Icons.ArrowSquareOut" OnSelect="OpenOriginal">
<Text>@Loc["Open original page"]</Text>
</MenuElement>

View file

@ -31,6 +31,9 @@ internal class NoteControllerModel(ApiClient api)
public Task<List<UserResponse>?> GetNoteReactions(string id, string name) =>
api.CallNullable<List<UserResponse>>(HttpMethod.Get, $"/notes/{id}/reactions/{name}");
public Task BiteNote(string id) =>
api.Call(HttpMethod.Post, $"/notes/{id}/bite");
public Task<ValueResponse?> LikeNote(string id) =>
api.CallNullable<ValueResponse>(HttpMethod.Post, $"/notes/{id}/like");