[frontend/components] Make cw button text change on state

This commit is contained in:
Lilian 2025-02-02 14:11:48 +01:00
parent 0aff68b398
commit a374c5e8c2
No known key found for this signature in database

View file

@ -13,13 +13,21 @@
<div class="cw"> <div class="cw">
<span class="cw-field"><MfmText Text="@NoteBase.Cw" Emoji="@NoteBase.Emoji" Simple="@true"/></span> <span class="cw-field"><MfmText Text="@NoteBase.Cw" Emoji="@NoteBase.Emoji" Simple="@true"/></span>
<button class="cw-button" @onclick="ToggleCw" @onclick:stopPropagation="true"> <button class="cw-button" @onclick="ToggleCw" @onclick:stopPropagation="true">
@if (_cwToggle)
{
@if (NoteBase.Text != null) @if (NoteBase.Text != null)
{ {
@Loc["Toggle CW ({0} Characters)", NoteBase.Text.Length] @Loc["Show Content ({0} Characters)", NoteBase.Text.Length]
} }
else else
{ {
@Loc["Toggle CW"] @Loc["Show Content"]
}
}
else
{
@Loc["Hide Content"]
} }
</button> </button>
</div> </div>