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 @@ +