[frontend/components] Added reply count to reply button

This commit is contained in:
Lilian 2024-09-23 19:54:01 +02:00
parent 4768bfaf3d
commit f48ff0c4b3
No known key found for this signature in database
3 changed files with 9 additions and 0 deletions

View file

@ -31,6 +31,7 @@
Likes="Note.Likes"
IsLiked="Note.Liked"
Renotes="Note.Renotes"
Replies="Note.Replies"
RenotePossible=
"@(Note.Visibility == NoteVisibility.Public || Note.Visibility == NoteVisibility.Home || Session.Current?.Id == Note.User.Id)"/>
}

View file

@ -20,6 +20,10 @@
}
<button class="btn" @onclick="Reply" @onclick:stopPropagation="true" aria-label="reply">
<Icon Name="Icons.ArrowUUpLeft" Size="1.3em"/>
@if (Replies > 0)
{
<span class="reply-count">@Replies</span>
}
</button>
<button class="btn @(RenotePossible ? "" : "disabled") positioned" @onclick="@(RenotePossible ? ToggleRenoteMenu : () => { })" @onclick:stopPropagation="true" aria-label="renote">
@if (RenotePossible)
@ -107,6 +111,7 @@
[Parameter] [EditorRequired] public required int Likes { get; set; }
[Parameter] [EditorRequired] public required bool IsLiked { get; set; }
[Parameter] [EditorRequired] public required int Renotes { get; set; }
[Parameter] [EditorRequired] public required int Replies { get; set; }
[Parameter] public bool RenotePossible { get; set; }
private Menu ContextMenu { get; set; } = null!;
private Menu RenoteMenu { get; set; } = null!;

View file

@ -15,6 +15,9 @@
.like-count {
margin-left: 0.3em;
}
.reply-count {
margin-left: 0.3em;
}
.renote-count {
margin-left: 0.3em;