Files
MassTech-UI/Components/App.razor
T

41 lines
1.4 KiB
Plaintext

@using LayoutLib
@if (_isLoaded)
{
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly" AdditionalAssemblies="new[] {
typeof(ECommerce.Module.Components.Pages.Shop.Shop).Assembly
}">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
You are not authorized to view this content, Please <a class="btn btn-primary" href="/SignIn">Sign
In</a>
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<div class="p-4 text-white">404 - Page not found at @DateTime.Now</div>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
}
else
{
<div class="text-white">Loading translations... @DateTime.Now</div>
}
@code {
private bool _isLoaded;
protected override async Task OnInitializedAsync()
{
// Load both resource files in parallel (ONCE for entire app)
_isLoaded = true;
}
}