diff --git a/Moonlight.Client/UI/Shell/AppHeader.razor b/Moonlight.Client/UI/Shell/AppHeader.razor
new file mode 100644
index 00000000..535e7dae
--- /dev/null
+++ b/Moonlight.Client/UI/Shell/AppHeader.razor
@@ -0,0 +1,30 @@
+@using MoonCore.Blazor.FlyonUi.Drawers
+
+@inject DrawerService DrawerService
+
+
+
+@code
+{
+ private async Task LaunchSidebarAsync()
+ {
+ await DrawerService.LaunchAsync
(unfocusHide: true);
+ }
+}
\ No newline at end of file
diff --git a/Moonlight.Client/UI/Shell/MainLayout.razor b/Moonlight.Client/UI/Shell/MainLayout.razor
new file mode 100644
index 00000000..6002dd57
--- /dev/null
+++ b/Moonlight.Client/UI/Shell/MainLayout.razor
@@ -0,0 +1,22 @@
+@using MoonCore.Blazor.FlyonUi.Drawers
+@using MoonCore.Blazor.FlyonUi.Modals
+@using MoonCore.Blazor.FlyonUi.Toasts
+
+@inherits LayoutComponentBase
+
+
\ No newline at end of file
diff --git a/Moonlight.Client/UI/Shell/SidebarComponent.razor b/Moonlight.Client/UI/Shell/SidebarComponent.razor
new file mode 100644
index 00000000..1b74d19c
--- /dev/null
+++ b/Moonlight.Client/UI/Shell/SidebarComponent.razor
@@ -0,0 +1,151 @@
+@using System.Security.Claims
+@using Microsoft.AspNetCore.Authorization
+@using Microsoft.AspNetCore.Components.Authorization
+@using Moonlight.Client.Interfaces
+@using Moonlight.Client.Models
+
+@inherits MoonCore.Blazor.FlyonUi.Drawers.DrawerBase
+
+@inject NavigationManager Navigation
+@inject IEnumerable SidebarItemProviders
+@inject IAuthorizationService AuthorizationService
+
+@implements IDisposable
+
+@{
+ var url = new Uri(Navigation.Uri);
+}
+
+
+
+
+
+
+
+@code
+{
+ [CascadingParameter] public Task AuthState { get; set; }
+
+ private Dictionary Items = new();
+
+ private string Username;
+ private string Email;
+ private ClaimsPrincipal Identity;
+
+ protected override async Task OnInitializedAsync()
+ {
+ var authState = await AuthState;
+
+ Identity = authState.User;
+ Username = Identity.FindFirst(ClaimTypes.Name)!.Value;
+ Email = Identity.FindFirst(ClaimTypes.Email)!.Value;
+
+ var sidebarItems = new List();
+
+ foreach (var provider in SidebarItemProviders)
+ provider.ModifySidebar(sidebarItems);
+
+ var itemsToRemove = new List();
+
+ foreach (var sidebarItem in sidebarItems)
+ {
+ if(string.IsNullOrEmpty(sidebarItem.Policy))
+ continue;
+
+ var authResult = await AuthorizationService.AuthorizeAsync(Identity, sidebarItem.Policy);
+
+ if(authResult.Succeeded)
+ continue;
+
+ itemsToRemove.Add(sidebarItem);
+ }
+
+ foreach (var sidebarItem in itemsToRemove)
+ sidebarItems.Remove(sidebarItem);
+
+ Items = sidebarItems
+ .GroupBy(x => x.Group ?? "")
+ .OrderByDescending(x => string.IsNullOrEmpty(x.Key))
+ .ToDictionary(x => x.Key, x => x.OrderBy(y => y.Priority).ToArray());
+
+ Navigation.LocationChanged += OnNavigated;
+ }
+
+ private async void OnNavigated(object? sender, LocationChangedEventArgs e)
+ {
+ // No async void without try catch to prevent hard app crashes when async task fails
+
+ try
+ {
+ await InvokeAsync(StateHasChanged);
+ }
+ catch (Exception)
+ {
+ // ignored
+ }
+ }
+
+ private Task LogoutAsync()
+ {
+ Navigation.NavigateTo("/api/auth/logout", true);
+ return Task.CompletedTask;
+ }
+
+ public void Dispose()
+ {
+ Navigation.LocationChanged -= OnNavigated;
+ }
+}
\ No newline at end of file
diff --git a/Moonlight.Client/UI/Shell/SidebarDrawer.razor b/Moonlight.Client/UI/Shell/SidebarDrawer.razor
new file mode 100644
index 00000000..2a2626a9
--- /dev/null
+++ b/Moonlight.Client/UI/Shell/SidebarDrawer.razor
@@ -0,0 +1,31 @@
+@inherits MoonCore.Blazor.FlyonUi.Drawers.DrawerBase
+
+@inject NavigationManager Navigation
+
+@implements IDisposable
+
+
+
+@code
+{
+ protected override void OnInitialized()
+ {
+ Navigation.LocationChanged += OnLocationChanged;
+ }
+
+ private async void OnLocationChanged(object? sender, LocationChangedEventArgs e)
+ {
+ try
+ {
+ await CloseAsync();
+ }
+ catch (Exception)
+ {
+ // Ignored
+ }
+ }
+
+ public void Dispose()
+ {
+ }
+}
\ No newline at end of file
diff --git a/Moonlight.Client/UI/Views/Admin/Sys/Customisation/Themes/Create.razor b/Moonlight.Client/UI/Views/Admin/Sys/Customisation/Themes/Create.razor
index 247bd319..ef66f2ff 100644
--- a/Moonlight.Client/UI/Views/Admin/Sys/Customisation/Themes/Create.razor
+++ b/Moonlight.Client/UI/Views/Admin/Sys/Customisation/Themes/Create.razor
@@ -68,12 +68,8 @@
{
return new ApplicationTheme()
{
- ColorBackground = "#0c0f18",
-
ColorBase100 = "#1e2b47",
- ColorBase150 = "#1a2640",
ColorBase200 = "#101a2e",
- ColorBase250 = "#0f1729",
ColorBase300 = "#0c1221",
ColorBaseContent = "#dde5f5",
diff --git a/Moonlight.Shared/Misc/ApplicationTheme.cs b/Moonlight.Shared/Misc/ApplicationTheme.cs
index b391ce59..f1cd4b4d 100644
--- a/Moonlight.Shared/Misc/ApplicationTheme.cs
+++ b/Moonlight.Shared/Misc/ApplicationTheme.cs
@@ -2,12 +2,8 @@ namespace Moonlight.Shared.Misc;
public class ApplicationTheme
{
- public string ColorBackground { get; set; }
-
public string ColorBase100 { get; set; }
- public string ColorBase150 { get; set; }
public string ColorBase200 { get; set; }
- public string ColorBase250 { get; set; }
public string ColorBase300 { get; set; }
public string ColorBaseContent { get; set; }
diff --git a/Moonlight.Shared/Moonlight.Shared.csproj b/Moonlight.Shared/Moonlight.Shared.csproj
index 452e911f..a2737bac 100644
--- a/Moonlight.Shared/Moonlight.Shared.csproj
+++ b/Moonlight.Shared/Moonlight.Shared.csproj
@@ -9,7 +9,7 @@
Moonlight.Shared
shared
Moonlight.Shared
- 2.1.14
+ 2.1.15
Moonlight Panel
A build of the shared classes for moonlight development
https://github.com/Moonlight-Panel/Moonlight