Skip to content

Commit c993fa9

Browse files
author
punkouter25
committed
Update client components and configuration
1 parent 1253c5f commit c993fa9

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed

PoFunQuiz.Client/Components/Pages/GameSetup.razor

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ else
5555
<RadzenColumn SizeSM="6" SizeXS="12" class="rz-mb-sm-0 rz-mb-3">
5656
<RadzenCard class="rz-p-2 rz-display-flex rz-flex-column rz-align-items-center">
5757
<RadzenText TextStyle="TextStyle.H5" class="rz-text-primary">Player 1</RadzenText>
58-
<RadzenAvatar Color="AvatarColor.Primary" Size="AvatarSize.Medium" class="rz-my-2" Text="@(GameState.CurrentGame?.Player1?.Initials ?? "P1")" />
58+
<div class="player-avatar player-avatar-primary rz-my-2">@(GameState.CurrentGame?.Player1?.Initials ?? "P1")</div>
5959
<RadzenText TextStyle="TextStyle.Body2" class="rz-mb-2">Use keys 1-4</RadzenText>
6060
@if (!Player1Ready)
6161
{
@@ -74,7 +74,7 @@ else
7474
<RadzenColumn SizeSM="6" SizeXS="12">
7575
<RadzenCard class="rz-p-2 rz-display-flex rz-flex-column rz-align-items-center">
7676
<RadzenText TextStyle="TextStyle.H5" class="rz-text-secondary">Player 2</RadzenText>
77-
<RadzenAvatar Color="AvatarColor.Secondary" Size="AvatarSize.Medium" class="rz-my-2" Text="@(GameState.CurrentGame?.Player2?.Initials ?? "P2")" />
77+
<div class="player-avatar player-avatar-secondary rz-my-2">@(GameState.CurrentGame?.Player2?.Initials ?? "P2")</div>
7878
<RadzenText TextStyle="TextStyle.Body2" class="rz-mb-2">Use keys 7-0</RadzenText>
7979
@if (!Player2Ready)
8080
{
@@ -96,6 +96,26 @@ else
9696
}
9797

9898
<style>
99+
.player-avatar {
100+
width: 64px;
101+
height: 64px;
102+
border-radius: 50%;
103+
display: flex;
104+
align-items: center;
105+
justify-content: center;
106+
font-weight: bold;
107+
font-size: 1.5rem;
108+
color: white;
109+
}
110+
111+
.player-avatar-primary {
112+
background-color: var(--rz-primary);
113+
}
114+
115+
.player-avatar-secondary {
116+
background-color: var(--rz-secondary);
117+
}
118+
99119
/* Keep responsive styles if needed, adjust for Radzen classes if necessary */
100120
@@media (max-width: 600px) {
101121
.rz-card { /* Example: if RadzenCard needs specific padding on mobile */

PoFunQuiz.Client/ExcludeUnusedRadzenThemes.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<Delete Files="@(RadzenCssToDelete)" />
1515
<Delete Files="@(SourceMapsToDelete)" />
1616

17-
<Message Text="Deleted $(RadzenCssToDelete.Count()) unused Radzen theme files" Importance="high" />
18-
<Message Text="Deleted $(SourceMapsToDelete.Count()) source map files" Importance="high" />
17+
<Message Text="Deleted @(RadzenCssToDelete->Count()) unused Radzen theme files" Importance="high" />
18+
<Message Text="Deleted @(SourceMapsToDelete->Count()) source map files" Importance="high" />
1919
</Target>
2020
</Project>

PoFunQuiz.Client/PoFunQuiz.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<DebugSymbols>false</DebugSymbols>
99
<InvariantGlobalization>true</InvariantGlobalization>
1010

11-
<!-- Optimization: Enable IL trimming to reduce deployment size -->
12-
<PublishTrimmed>true</PublishTrimmed>
13-
<TrimMode>link</TrimMode>
11+
<!-- Trimming disabled to ensure consistent behavior between local and Azure deployments -->
12+
<!--<PublishTrimmed>true</PublishTrimmed>-->
13+
<!--<TrimMode>link</TrimMode>-->
1414

1515
<!-- Optimization: Remove debug symbols and source maps from production builds -->
1616
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>

PoFunQuiz.Client/Services/ClientQuestionGeneratorService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public ClientQuestionGeneratorService(HttpClient httpClient)
2121
public async Task<List<QuizQuestion>> GenerateQuestionsAsync(int count)
2222
{
2323
// Call the server-side API to generate questions
24-
return await _httpClient.GetFromJsonAsync<List<QuizQuestion>>($"/api/quiz/generate?count={count}");
24+
return await _httpClient.GetFromJsonAsync<List<QuizQuestion>>($"/api/quiz/generate?count={count}") ?? new List<QuizQuestion>();
2525
}
2626

2727
public async Task<List<QuizQuestion>> GenerateQuestionsInCategoryAsync(int count, string category)
2828
{
2929
// Call the server-side API to generate questions in a specific category
30-
return await _httpClient.GetFromJsonAsync<List<QuizQuestion>>($"/api/quiz/generateincategory?count={count}&category={category}");
30+
return await _httpClient.GetFromJsonAsync<List<QuizQuestion>>($"/api/quiz/generateincategory?count={count}&category={category}") ?? new List<QuizQuestion>();
3131
}
3232
}
3333
}

0 commit comments

Comments
 (0)