From 25da138e25e1109f4f4b4173f72d9abeb6989ee9 Mon Sep 17 00:00:00 2001 From: Olivier Lefebvre Date: Wed, 8 Mar 2023 23:18:33 +0100 Subject: [PATCH] feat: admin app dark theme * build: bump bootstrap * feat: admin app dark theme --------- Co-authored-by: github-actions --- .../App.razor | 2 + .../App.razor.cs | 9 +- .../Shared/MainLayout.razor | 7 +- .../wwwroot/css/app.css | 11 - .../wwwroot/index.html | 8 +- .../Extensions/ServiceCollectionExtensions.cs | 29 +- .../Views/Shared/_Layout.cshtml | 4 +- .../Models/SiteOptions.cs | 4 +- src/Aguacongas.TheIdServer/Pages/_Host.cshtml | 14 +- .../DeleteEntityButton.razor | 2 +- .../EntityInfo.razor | 2 +- .../Form/SaveButton.razor | 4 +- .../NavMenu.razor | 30 +- .../NavMenu.razor.cs | 2 +- .../ThemeButton.razor | 4 + .../ThemeButton.razor.cs | 19 + .../WebAssemblyHostBuilderExtensions.cs | 3 +- .../Services/ThemeService.cs | 26 + .../wwwroot/.eslintrc.js | 15 + .../wwwroot/TheIdServerInterop.js | 115 +- .../wwwroot/package-lock.json | 3832 +++++++++++++++++ .../wwwroot/package.json | 9 + .../Api.razor | 8 +- .../ApiScope.razor | 8 +- .../ApiScopes.razor | 4 +- .../Apis.razor | 6 +- .../Client.razor | 8 +- .../Clients.razor | 6 +- .../Culture.razor | 8 +- .../Cultures.razor | 6 +- .../ExternalProvider.razor | 8 +- .../ExternalProviders.razor | 6 +- .../Indenties.razor | 6 +- .../Identity.razor | 8 +- .../Components/RevokeButton.razor | 2 +- .../RelyingParties.razor | 6 +- .../RelyingParty.razor | 8 +- .../Role.razor | 8 +- .../Roles.razor | 6 +- .../User.razor | 8 +- .../Users.razor | 6 +- 41 files changed, 4099 insertions(+), 178 deletions(-) create mode 100644 src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ThemeButton.razor create mode 100644 src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Components/ThemeButton.razor.cs create mode 100644 src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Services/ThemeService.cs create mode 100644 src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/wwwroot/.eslintrc.js create mode 100644 src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/wwwroot/package-lock.json create mode 100644 src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/wwwroot/package.json diff --git a/src/Aguacongas.TheIdServer.BlazorApp/App.razor b/src/Aguacongas.TheIdServer.BlazorApp/App.razor index f179c46a7..23f3005dc 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/App.razor +++ b/src/Aguacongas.TheIdServer.BlazorApp/App.razor @@ -3,6 +3,8 @@ @using Microsoft.Extensions.Logging @inject LazyAssemblyLoader _assemblyLoader @inject ILogger _logger +@inject ThemeService _themeService + diff --git a/src/Aguacongas.TheIdServer.BlazorApp/App.razor.cs b/src/Aguacongas.TheIdServer.BlazorApp/App.razor.cs index e7e7a6df1..aaea11976 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/App.razor.cs +++ b/src/Aguacongas.TheIdServer.BlazorApp/App.razor.cs @@ -1,5 +1,6 @@ // Project: Aguafrommars/TheIdServer // Copyright (c) 2023 @Olivier Lefebvre +using Aguacongas.TheIdServer.BlazorApp.Services; using Microsoft.AspNetCore.Components.Routing; using System.Reflection; @@ -30,7 +31,13 @@ public partial class App "Settings" }; - private Task OnNavigateAsync(NavigationContext args) + protected override async Task OnInitializedAsync() + { + await base.OnInitializedAsync().ConfigureAwait(false); + await _themeService.InitAsync().ConfigureAwait(false); + } + + private Task OnNavigateAsync(NavigationContext args) { var path = args.Path.Split("/")[0]; if (path == "protectresource") diff --git a/src/Aguacongas.TheIdServer.BlazorApp/Shared/MainLayout.razor b/src/Aguacongas.TheIdServer.BlazorApp/Shared/MainLayout.razor index 126885b61..b66a67684 100644 --- a/src/Aguacongas.TheIdServer.BlazorApp/Shared/MainLayout.razor +++ b/src/Aguacongas.TheIdServer.BlazorApp/Shared/MainLayout.razor @@ -3,14 +3,15 @@ @inherits LayoutComponentBase -