38 lines
No EOL
1.3 KiB
Text
38 lines
No EOL
1.3 KiB
Text
@using Iceshrimp.Frontend.Localization
|
|
@using Iceshrimp.Shared.Schemas.Web
|
|
@using Microsoft.Extensions.Localization
|
|
@using Iceshrimp.Assets.PhosphorIcons
|
|
@using Iceshrimp.Frontend.Core.Services
|
|
@inject IStringLocalizer<Localization> Loc;
|
|
@inject ApiService Api;
|
|
@inject NavigationManager NavigationManager;
|
|
|
|
|
|
<div class="follow-request-card">
|
|
<UserProfileCard User="FollowRequest.User" ShowBio="false"></UserProfileCard>
|
|
<div class="buttons">
|
|
<button @onclick="Accept" class="btn accept">
|
|
<Icon Name="Icons.Check"/>
|
|
</button>
|
|
<button @onclick="Reject" class="btn decline">
|
|
<Icon Name="Icons.X"/>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter] [EditorRequired] public required FollowRequestResponse FollowRequest { get; set; }
|
|
private async void Accept()
|
|
{
|
|
// FIXME: This should be a fancy animation instead of a reload
|
|
await Api.FollowRequests.AcceptFollowRequest(FollowRequest.Id);
|
|
NavigationManager.NavigateTo("/follow-requests");
|
|
}
|
|
|
|
private async void Reject()
|
|
{
|
|
// FIXME: This should be a fancy animation instead of a reloady
|
|
await Api.FollowRequests.RejectFollowRequest(FollowRequest.Id);
|
|
NavigationManager.NavigateTo("/follow-requests");
|
|
}
|
|
} |