From 1057dc0ad86e6ac6a8f57fc17513dda14129b193 Mon Sep 17 00:00:00 2001 From: shiibe Date: Sun, 1 Oct 2023 08:09:04 -0400 Subject: [PATCH] Add QR Code dialog, fix styles --- TaikoWebUI/Pages/Cards.razor | 9 ++++- TaikoWebUI/Pages/Cards.razor.cs | 11 ++++++ .../Pages/Dialogs/UserQrCodeDialog.razor | 39 +++++++++++++++++++ TaikoWebUI/TaikoWebUI.csproj | 3 +- 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 TaikoWebUI/Pages/Dialogs/UserQrCodeDialog.razor diff --git a/TaikoWebUI/Pages/Cards.razor b/TaikoWebUI/Pages/Cards.razor index 27e2477..eb45fcd 100644 --- a/TaikoWebUI/Pages/Cards.razor +++ b/TaikoWebUI/Pages/Cards.razor @@ -40,6 +40,11 @@ + + Show QR Code + @@ -50,7 +55,7 @@ Access Code - @user.AccessCode + @user.AccessCode @@ -85,4 +90,4 @@ } - \ No newline at end of file + diff --git a/TaikoWebUI/Pages/Cards.razor.cs b/TaikoWebUI/Pages/Cards.razor.cs index fd5c41b..1a1a913 100644 --- a/TaikoWebUI/Pages/Cards.razor.cs +++ b/TaikoWebUI/Pages/Cards.razor.cs @@ -30,4 +30,15 @@ public partial class Cards response = await Client.GetFromJsonAsync("api/Dashboard"); } + private Task ShowQrCode(User user) + { + var parameters = new DialogParameters + { + ["user"] = user + }; + + DialogService.Show("QR Code", parameters); + + return Task.CompletedTask; + } } \ No newline at end of file diff --git a/TaikoWebUI/Pages/Dialogs/UserQrCodeDialog.razor b/TaikoWebUI/Pages/Dialogs/UserQrCodeDialog.razor new file mode 100644 index 0000000..03007a9 --- /dev/null +++ b/TaikoWebUI/Pages/Dialogs/UserQrCodeDialog.razor @@ -0,0 +1,39 @@ +@using TaikoWebUI.Shared.Models +@using System.Collections.Immutable +@inject IGameDataService GameDataService + + + + + + + Ok + + + +@code { + + [CascadingParameter] + MudDialogInstance MudDialog { get; set; } = null!; + + [Parameter] + public User User { get; set; } = new(); + + private string qrCode = string.Empty; + + protected override void OnInitialized() + { + base.OnInitialized(); + qrCode = "BNTTCNID" + User.AccessCode; + } + + private void Submit() + { + MudDialog.Close(DialogResult.Ok(true)); + } +} \ No newline at end of file diff --git a/TaikoWebUI/TaikoWebUI.csproj b/TaikoWebUI/TaikoWebUI.csproj index d10f3ef..bb5ad8e 100644 --- a/TaikoWebUI/TaikoWebUI.csproj +++ b/TaikoWebUI/TaikoWebUI.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -9,6 +9,7 @@ +