[frontend] Add "reaction" notification type

This commit is contained in:
Lilian 2024-06-28 21:35:58 +02:00 committed by Laura Hausmann
parent ffe56307f3
commit b39007362c
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -5,9 +5,8 @@
@inject IStringLocalizer<Localization> Loc; @inject IStringLocalizer<Localization> Loc;
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
<div class="notification"> <div class="notification">
@if (NotificationResponse is { User: not null, Type: "like" or "follow" }) @if (NotificationResponse is { User: not null, Type: "like" or "follow" or "reaction" })
{ {
<img class="user-avatar" src="@NotificationResponse.User.AvatarUrl"/> <img class="user-avatar" src="@NotificationResponse.User.AvatarUrl"/>
<div class="notification-body"> <div class="notification-body">
@ -16,7 +15,13 @@
@if (NotificationResponse is { Note: not null, Type: "like", User: not null }) @if (NotificationResponse is { Note: not null, Type: "like", User: not null })
{ {
<span @onclick="OpenNote" class="notification-text"> <span @onclick="OpenNote" class="notification-text">
@Loc["liked your post: \"{0}\"", NotificationResponse.Note.Text ?? NotificationResponse.Note.Cw ?? "This one!"] @Loc["liked your post: "]<MfmText Text="@NotificationResponse.Note.Text"></MfmText>
</span>
}
@if (NotificationResponse is { Note: not null, Type: "reaction" })
{
<span @onclick="OpenNote" class="notification-text">
@Loc["reacted to your post: "] <MfmText Text="@NotificationResponse.Note.Text"></MfmText>
</span> </span>
} }