state after adding all of the user stuff and messing around with the wierd brave bug
This commit is contained in:
35
OpenArchival.Blazor/Components/Pages/Home.razor
Normal file
35
OpenArchival.Blazor/Components/Pages/Home.razor
Normal file
@@ -0,0 +1,35 @@
|
||||
@using Microsoft.Extensions.Options
|
||||
@using OpenArchival.Blazor.Config;
|
||||
|
||||
@page "/"
|
||||
|
||||
<PageTitle>Home</PageTitle>
|
||||
@if (string.IsNullOrEmpty(_htmlContent))
|
||||
{
|
||||
<p>Loading content...</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
@((MarkupString)_htmlContent)
|
||||
}
|
||||
|
||||
@inject IOptions<ApplicationOptions> AppOptions;
|
||||
@code {
|
||||
private string _htmlContent = $"<h1>HTML file not found for homepage. Create one at /admin/homepageeditor</h1>";
|
||||
|
||||
protected override async void OnInitialized()
|
||||
{
|
||||
try
|
||||
{
|
||||
using var reader = new StreamReader(AppOptions.Value.HomepageContentLocation);
|
||||
_htmlContent = await reader.ReadToEndAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_htmlContent = $"<h1>HTML file not found for homepage. Create one at /admin/homepageeditor</h1>";
|
||||
}
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user