1
0
mirror of synced 2025-01-19 00:04:05 +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
{
<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>
<MudTh>@Localizer["Rank"]</MudTh>
<MudTh>@Localizer["Player"]</MudTh>

View File

@ -55,4 +55,9 @@ public partial class SongLeaderboardCard
response.ThrowIfNull();
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);
}
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 {
min-width: 26px;
}