42 lines
No EOL
1.5 KiB
Text
42 lines
No EOL
1.5 KiB
Text
@using Microsoft.AspNetCore.Components.Authorization
|
|
@inject NavigationManager navigationManager
|
|
<Router AppAssembly="@typeof(MauiProgram).Assembly">
|
|
<Found Context="routeData">
|
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
|
|
<Authorizing>
|
|
<div class="no-border responsive max no-padding center-align middle-align">
|
|
<div class="padding">
|
|
<img src="/img/prami-neighbourhood.svg" class="extra" />
|
|
</div>
|
|
</div>
|
|
</Authorizing>
|
|
<NotAuthorized><RedirectToLogin /></NotAuthorized>
|
|
</AuthorizeRouteView>
|
|
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
|
</Found>
|
|
<NotFound>
|
|
<CascadingAuthenticationState>
|
|
<LayoutView Layout="@typeof(Layout.MainLayout)">
|
|
<div class="no-border responsive max no-padding center-align middle-align">
|
|
<div class="padding">
|
|
<img src="/img/prami-neighbourhood.svg" class="extra" />
|
|
<p>Sorry, you seem to have landed nowhere.</p>
|
|
<small>@navigationManager.Uri</small>
|
|
</div>
|
|
</div>
|
|
</LayoutView>
|
|
</CascadingAuthenticationState>
|
|
</NotFound>
|
|
</Router>
|
|
|
|
|
|
@code
|
|
{
|
|
protected override void OnAfterRender(bool firstRender) {
|
|
string? shareString = Preferences.Get("shareString", null);
|
|
if (!string.IsNullOrWhiteSpace(shareString)) {
|
|
Preferences.Remove("shareString");
|
|
navigationManager.NavigateTo($"/sharetext/{shareString}");
|
|
}
|
|
}
|
|
} |