Recreated solution with web app template. Improved theme. Switched to ShadcnBlazor library
This commit is contained in:
9
Moonlight.Frontend/Startup/IAppStartup.cs
Normal file
9
Moonlight.Frontend/Startup/IAppStartup.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
|
||||
namespace Moonlight.Frontend.Startup;
|
||||
|
||||
public interface IAppStartup
|
||||
{
|
||||
public void PreBuild(WebAssemblyHostBuilder builder);
|
||||
public void PostBuild(WebAssemblyHost application);
|
||||
}
|
||||
16
Moonlight.Frontend/Startup/Startup.Auth.cs
Normal file
16
Moonlight.Frontend/Startup/Startup.Auth.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moonlight.Frontend.Services;
|
||||
|
||||
namespace Moonlight.Frontend.Startup;
|
||||
|
||||
public partial class Startup
|
||||
{
|
||||
public void AddAuth(WebAssemblyHostBuilder builder)
|
||||
{
|
||||
builder.Services.AddScoped<AuthenticationStateProvider, RemoteAuthProvider>();
|
||||
builder.Services.AddAuthorizationCore();
|
||||
builder.Services.AddCascadingAuthenticationState();
|
||||
}
|
||||
}
|
||||
22
Moonlight.Frontend/Startup/Startup.Base.cs
Normal file
22
Moonlight.Frontend/Startup/Startup.Base.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moonlight.Frontend.UI;
|
||||
using ShadcnBlazor;
|
||||
using ShadcnBlazor.Extras;
|
||||
|
||||
namespace Moonlight.Frontend.Startup;
|
||||
|
||||
public partial class Startup
|
||||
{
|
||||
public void AddBase(WebAssemblyHostBuilder builder)
|
||||
{
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
|
||||
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
||||
|
||||
builder.Services.AddShadcnBlazor();
|
||||
builder.Services.AddShadcnBlazorExtras();
|
||||
}
|
||||
}
|
||||
17
Moonlight.Frontend/Startup/Startup.cs
Normal file
17
Moonlight.Frontend/Startup/Startup.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
|
||||
namespace Moonlight.Frontend.Startup;
|
||||
|
||||
public partial class Startup : IAppStartup
|
||||
{
|
||||
public void PreBuild(WebAssemblyHostBuilder builder)
|
||||
{
|
||||
AddBase(builder);
|
||||
AddAuth(builder);
|
||||
}
|
||||
|
||||
public void PostBuild(WebAssemblyHost application)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user