From 05105f4722d6f8605d08bb84ff876d97447c0cb4 Mon Sep 17 00:00:00 2001 From: Ben Sampica Date: Fri, 18 Nov 2022 12:44:05 -0600 Subject: [PATCH] Added new dashboard item for league changes (#174) --- .../Features/Dashboard/ChangeList.razor | 47 +++++++++++++++++++ src/Client/Features/Dashboard/Dashboard.razor | 7 ++- .../Dashboard/Shared/RankedList.razor | 4 +- .../Features/Dashboard/TopOffenders.razor | 1 - .../Features/Dashboard/TopTeamFines.razor | 1 - src/Client/Shared/MainLayout.razor | 35 ++++++++++---- src/Client/wwwroot/css/app.css | 2 +- src/Server/Features/Admin/Users/Delete.cs | 2 +- .../Identity/CurrentUserService.cs | 2 +- 9 files changed, 83 insertions(+), 18 deletions(-) create mode 100644 src/Client/Features/Dashboard/ChangeList.razor diff --git a/src/Client/Features/Dashboard/ChangeList.razor b/src/Client/Features/Dashboard/ChangeList.razor new file mode 100644 index 0000000..0507e4c --- /dev/null +++ b/src/Client/Features/Dashboard/ChangeList.razor @@ -0,0 +1,47 @@ + + + + + + Change Log + + Want something? Tell us! + + + + + Released Changes + + + Auto-bidding! You can now set a maximum bid you would pay for a player and will only pay what others try to outbid you at. + + + Teams can now be fined. Obey the rules and don't miss dates or face the wrath of the League! + + + All-around performance improvements. + + + Light mode! Additionally, Light/Dark mode is now detected based on your device preference. + + + + + Planned Changes + + + Facilitating the rookie draft entirely in-house. + + + Higher class connectivity to the leagues in Yahoo. + + + Login with any provider - Google, Facebook, etc. + + + You've been outbid notifications via email. + + + + + diff --git a/src/Client/Features/Dashboard/Dashboard.razor b/src/Client/Features/Dashboard/Dashboard.razor index c89cdf5..907adbb 100644 --- a/src/Client/Features/Dashboard/Dashboard.razor +++ b/src/Client/Features/Dashboard/Dashboard.razor @@ -5,10 +5,13 @@ - + - + + + + \ No newline at end of file diff --git a/src/Client/Features/Dashboard/Shared/RankedList.razor b/src/Client/Features/Dashboard/Shared/RankedList.razor index d1a85ea..507ecb8 100644 --- a/src/Client/Features/Dashboard/Shared/RankedList.razor +++ b/src/Client/Features/Dashboard/Shared/RankedList.razor @@ -2,7 +2,7 @@ { @{ - var first =RankedItems.First(); + var first = RankedItems.First(); var second = RankedItems.Skip(1).First(); var third = RankedItems.Skip(2).First(); } @@ -12,7 +12,7 @@ @foreach(var rankedItem in RankedItems.Skip(3)) { - + } diff --git a/src/Client/Features/Dashboard/TopOffenders.razor b/src/Client/Features/Dashboard/TopOffenders.razor index 79649f9..5588966 100644 --- a/src/Client/Features/Dashboard/TopOffenders.razor +++ b/src/Client/Features/Dashboard/TopOffenders.razor @@ -28,7 +28,6 @@ else Top Offenders - There aren't enough players with fines quite yet. Check back later! diff --git a/src/Client/Features/Dashboard/TopTeamFines.razor b/src/Client/Features/Dashboard/TopTeamFines.razor index cfb4c88..797de6b 100644 --- a/src/Client/Features/Dashboard/TopTeamFines.razor +++ b/src/Client/Features/Dashboard/TopTeamFines.razor @@ -28,7 +28,6 @@ else Top Team Fines - There aren't enough teams with fines quite yet. Check back later! diff --git a/src/Client/Shared/MainLayout.razor b/src/Client/Shared/MainLayout.razor index 075d21f..46c9380 100644 --- a/src/Client/Shared/MainLayout.razor +++ b/src/Client/Shared/MainLayout.razor @@ -29,12 +29,12 @@ - + - - - - + + + + @@ -43,12 +43,15 @@ - + @code { + private MudThemeProvider? _mudThemeProvider; + private bool _isDarkMode; private static string[] HeaderFontFamily = new[] { "Graduate", "cursive" }; - - private MudTheme darkTheme = new MudTheme() + private Color buttonColor; + private Color appBarColor; + private MudTheme _baseTheme = new MudTheme() { Typography = new Typography { @@ -61,10 +64,24 @@ H6 = new H6 { FontFamily = HeaderFontFamily } } }; - private ErrorBoundary? _errorBoundary; private bool _showNavMenu; + protected override void OnInitialized() + { + buttonColor = _isDarkMode ? Color.Primary : Color.Dark; + appBarColor = _isDarkMode ? Color.Dark : Color.Primary; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + _isDarkMode = await _mudThemeProvider!.GetSystemPreference(); + StateHasChanged(); + } + } + protected override void OnParametersSet() { _errorBoundary?.Recover(); diff --git a/src/Client/wwwroot/css/app.css b/src/Client/wwwroot/css/app.css index 2702cc2..89fe803 100644 --- a/src/Client/wwwroot/css/app.css +++ b/src/Client/wwwroot/css/app.css @@ -58,7 +58,7 @@ html, body { } .mud-table-striped .mud-table-container .mud-table-root .mud-table-body .mud-table-row:nth-of-type(odd) { - background-color: #32333d !important; + background-color: var(--mud-palette-table-lines) !important; } .mud-xs-table .mud-table-row { diff --git a/src/Server/Features/Admin/Users/Delete.cs b/src/Server/Features/Admin/Users/Delete.cs index 6279fd4..7fd6ec3 100644 --- a/src/Server/Features/Admin/Users/Delete.cs +++ b/src/Server/Features/Admin/Users/Delete.cs @@ -39,7 +39,7 @@ public async Task Handle(DeleteCommand request, CancellationToken cancella { var user = await _userManager.FindByIdAsync(request.UserId); - await _userManager.DeleteAsync(user); + await _userManager.DeleteAsync(user!); return Unit.Value; } diff --git a/src/Server/Infrastructure/Identity/CurrentUserService.cs b/src/Server/Infrastructure/Identity/CurrentUserService.cs index 1d66c87..7659b6c 100644 --- a/src/Server/Infrastructure/Identity/CurrentUserService.cs +++ b/src/Server/Infrastructure/Identity/CurrentUserService.cs @@ -14,5 +14,5 @@ public CurrentUserService(IHttpContextAccessor httpContextAccessor) _httpContextAccessor = httpContextAccessor; } - public int GetTeamId() => _httpContextAccessor.HttpContext.User.GetTeamId(); + public int GetTeamId() => _httpContextAccessor.HttpContext!.User.GetTeamId(); }