1
0
mirror of synced 2025-01-31 12:23:50 +01:00

Highlight current user in leaderboard

This commit is contained in:
shiibe 2024-06-04 19:53:41 -04:00
parent 20525fb014
commit 96db68b94b
3 changed files with 16 additions and 1 deletions

View File

@ -44,7 +44,7 @@
} }
else else
{ {
<MudTable Loading="isLoading" Items="@response.Leaderboard" Class="leaderboard-table" Elevation="0" Outlined="false" Dense="true" Striped="true"> <MudTable RowClassFunc="@GetActiveRowClass" Loading="isLoading" Items="@response.Leaderboard" Class="leaderboard-table" Elevation="0" Outlined="false" Dense="true" Striped="true">
<HeaderContent> <HeaderContent>
<MudTh>@Localizer["Rank"]</MudTh> <MudTh>@Localizer["Rank"]</MudTh>
<MudTh>@Localizer["Player"]</MudTh> <MudTh>@Localizer["Player"]</MudTh>

View File

@ -55,4 +55,9 @@ public partial class SongLeaderboardCard
response.ThrowIfNull(); response.ThrowIfNull();
isLoading = false; isLoading = false;
} }
private string GetActiveRowClass(SongLeaderboard leaderboard, int index)
{
return leaderboard.Baid == Baid ? "is-current-user" : "";
}
} }

View File

@ -55,6 +55,16 @@
transform: scale(1.1); transform: scale(1.1);
} }
tr.is-current-user {
background-color: #bad4f5;
}
tr.is-current-user td,
tr.is-current-user span,
tr.is-current-user p {
font-weight: bold;
}
.lang-menu-item .mud-list-item-icon { .lang-menu-item .mud-list-item-icon {
min-width: 26px; min-width: 26px;
} }