Files

39 lines
1.4 KiB
Plaintext

@if (_isLoaded)
{
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly" AdditionalAssemblies="new[] {
typeof(ECommerceModule.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)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
}
else
{
<div>Loading translations...</div>
}
@code {
private bool _isLoaded;
protected override async Task OnInitializedAsync()
{
// Load both resource files in parallel (ONCE for entire app)
_isLoaded = true;
}
}