Skip to content

Commit

Permalink
(#417) web: install blaozrize
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Sep 19, 2024
1 parent 278eba5 commit 0593b41
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap5" Version="1.6.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.6" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Blazorise" Version="1.5.1" />
<PackageReference Include="Blazorise.Bootstrap" Version="1.5.1" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.5.1" />
<PackageReference Include="Blazorise" Version="1.6.1" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.6.1" />
<PackageReference Include="Cropper.Blazor" Version="1.3.2" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="6.0.0" />
<PackageReference Include="MudBlazor" Version="6.20.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@
return friends.Any(f => f.FriendId == friend.FriendId);
}

private bool ShouldDisplayGallery(Visibility galleryVisibility)
private bool ShouldDisplayGallery(DTO.Visibility galleryVisibility)
{
return galleryVisibility == Visibility.Everyone || (galleryVisibility == Visibility.Connections && IsFriend(null));
}
Expand Down
17 changes: 4 additions & 13 deletions MiniSpace.Web/src/Astravent.Web.Wasm/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

// Load appsettings based on the environment
if (builder.HostEnvironment.IsDevelopment())
{
builder.Configuration.AddJsonFile("appsettings.Development.json", optional: false, reloadOnChange: true);
Expand All @@ -38,39 +37,32 @@
builder.Configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
}

// Load HttpClientOptions from configuration
var httpClientOptions = builder.Configuration.GetSection("HttpClientOptions").Get<HttpClientOptions>();

if (httpClientOptions == null || string.IsNullOrEmpty(httpClientOptions.ApiUrl))
{
throw new InvalidOperationException("HttpClientOptions must be configured with a valid ApiUrl.");
}

// Register HttpClientOptions in DI
builder.Services.AddSingleton(httpClientOptions);

// Custom HttpClient registration with HttpClientOptions
builder.Services.AddHttpClient<IHttpClient, CustomHttpClient>((serviceProvider, client) =>
{
var options = serviceProvider.GetRequiredService<HttpClientOptions>();
client.BaseAddress = new Uri(options.ApiUrl);
});

// Register services

builder.Services.AddMudServices(); // MudBlazor services
builder.Services.AddMudMarkdownServices(); // MudBlazor Markdown support
builder.Services.AddBlazoredLocalStorage(); // Local storage
builder.Services.AddMudServices();
builder.Services.AddMudMarkdownServices();
builder.Services.AddBlazoredLocalStorage();

// Radzen Dialog and Notification services
builder.Services.AddScoped<NotificationService>();

// Identity and authentication-related services
builder.Services.AddScoped<IIdentityService, IdentityService>();
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthenticationStateProvider>();
builder.Services.AddAuthorizationCore(); // For handling authentication/authorization in WebAssembly
builder.Services.AddAuthorizationCore();

// Register other services
builder.Services.AddScoped<IStudentsService, StudentsService>();
builder.Services.AddScoped<IEventsService, EventsService>();
builder.Services.AddScoped<IPostsService, PostsService>();
Expand All @@ -84,7 +76,6 @@
builder.Services.AddScoped<IReportsService, ReportsService>();
builder.Services.AddScoped<ICommunicationService, CommunicationService>();

// If SignalR is used, configure it like this
builder.Services.AddScoped<SignalRService>();
builder.Services.AddScoped<ChatSignalRService>();

Expand Down
1 change: 1 addition & 0 deletions MiniSpace.Web/src/Astravent.Web.Wasm/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@
@using Astravent.Web.Wasm.Areas.Communication.CommandsDto

@using Astravent.Web.Wasm.DTO.Users

6 changes: 6 additions & 0 deletions MiniSpace.Web/src/Astravent.Web.Wasm/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
<link rel="apple-touch-icon" sizes="192x192" href="icon-192.png" />

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<link href="_content/Blazorise.Icons.FontAwesome/v6/css/all.min.css" rel="stylesheet">

<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
<link href="_content/Blazorise.Bootstrap5/blazorise.bootstrap5.css" rel="stylesheet" />

<!-- PWA Theme Color -->
<meta name="theme-color" content="#03173d" />
</head>
Expand Down

0 comments on commit 0593b41

Please sign in to comment.