Implemented frontend configuration service and dynamic theme reloading integration. Updated sidebar to display dynamic application name.
All checks were successful
Dev Publish: Nuget / Publish Dev Packages (push) Successful in 48s
All checks were successful
Dev Publish: Nuget / Publish Dev Packages (push) Successful in 48s
This commit was merged in pull request #6.
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using System.Text.Json
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
@using Moonlight.Frontend.Interfaces
|
||||
@using Moonlight.Frontend.Models
|
||||
@using Moonlight.Frontend.Services
|
||||
@using ShadcnBlazor.Sidebars
|
||||
|
||||
@inject NavigationManager Navigation
|
||||
@inject IAuthorizationService AuthorizationService
|
||||
@inject FrontendService FrontendService
|
||||
@inject IEnumerable<ISidebarProvider> Providers
|
||||
|
||||
@implements IDisposable
|
||||
@@ -21,7 +24,7 @@
|
||||
<SidebarMenuButton>
|
||||
<a href="/" class="flex flex-row items-center">
|
||||
<img alt="Logo" src="/_content/Moonlight.Frontend/logo.svg" class="size-6"/>
|
||||
<span class="ms-2.5 text-lg font-semibold">Moonlight</span>
|
||||
<span class="ms-2.5 text-lg font-semibold">@FrontendConfiguration?.Name</span>
|
||||
</a>
|
||||
</SidebarMenuButton>
|
||||
</SidebarMenuItem>
|
||||
@@ -74,6 +77,7 @@
|
||||
[CascadingParameter] public Task<AuthenticationState> AuthState { get; set; }
|
||||
|
||||
private readonly List<SidebarItem> Items = new();
|
||||
private FrontendConfiguration? FrontendConfiguration;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@@ -98,6 +102,10 @@
|
||||
}
|
||||
|
||||
Navigation.LocationChanged += OnLocationChanged;
|
||||
|
||||
FrontendConfiguration = await FrontendService.GetConfigurationAsync();
|
||||
|
||||
Console.WriteLine(JsonSerializer.Serialize(FrontendConfiguration));
|
||||
}
|
||||
|
||||
private async void OnLocationChanged(object? sender, LocationChangedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user