[frontend] Add bite button to note's more menu
This commit is contained in:
parent
d546cc8733
commit
ed81306ef1
3 changed files with 14 additions and 0 deletions
|
@ -166,6 +166,11 @@ public partial class Note : IDisposable
|
||||||
ComposeService.ComposeDialog?.OpenDialogRedraft(NoteResponse);
|
ComposeService.ComposeDialog?.OpenDialogRedraft(NoteResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async void Bite()
|
||||||
|
{
|
||||||
|
await ApiService.Notes.BiteNote(NoteResponse.Id);
|
||||||
|
}
|
||||||
|
|
||||||
public async void Mute()
|
public async void Mute()
|
||||||
{
|
{
|
||||||
await ApiService.Notes.MuteNote(NoteResponse.Id);
|
await ApiService.Notes.MuteNote(NoteResponse.Id);
|
||||||
|
|
|
@ -82,6 +82,12 @@
|
||||||
<Text>@Loc["Redraft"]</Text>
|
<Text>@Loc["Redraft"]</Text>
|
||||||
</MenuElement>
|
</MenuElement>
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MenuElement Icon="Icons.Tooth" OnSelect="Note.Bite">
|
||||||
|
<Text>@Loc["Bite"]</Text>
|
||||||
|
</MenuElement>
|
||||||
|
}
|
||||||
<MenuElement Icon="Icons.ArrowSquareOut" OnSelect="OpenOriginal">
|
<MenuElement Icon="Icons.ArrowSquareOut" OnSelect="OpenOriginal">
|
||||||
<Text>@Loc["Open original page"]</Text>
|
<Text>@Loc["Open original page"]</Text>
|
||||||
</MenuElement>
|
</MenuElement>
|
||||||
|
|
|
@ -31,6 +31,9 @@ internal class NoteControllerModel(ApiClient api)
|
||||||
public Task<List<UserResponse>?> GetNoteReactions(string id, string name) =>
|
public Task<List<UserResponse>?> GetNoteReactions(string id, string name) =>
|
||||||
api.CallNullable<List<UserResponse>>(HttpMethod.Get, $"/notes/{id}/reactions/{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) =>
|
public Task<ValueResponse?> LikeNote(string id) =>
|
||||||
api.CallNullable<ValueResponse>(HttpMethod.Post, $"/notes/{id}/like");
|
api.CallNullable<ValueResponse>(HttpMethod.Post, $"/notes/{id}/like");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue