2024-05-31 13:16:09 +00:00
|
|
|
@using Microsoft.AspNetCore.Components.Authorization
|
2024-06-14 07:20:04 +00:00
|
|
|
@inject NavigationManager navigationManager
|
2024-05-31 13:16:09 +00:00
|
|
|
<Router AppAssembly="@typeof(MauiProgram).Assembly">
|
|
|
|
<Found Context="routeData">
|
|
|
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
|
2024-06-24 01:40:24 +00:00
|
|
|
<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>
|
2024-05-31 13:16:09 +00:00
|
|
|
<NotAuthorized><RedirectToLogin /></NotAuthorized>
|
|
|
|
</AuthorizeRouteView>
|
|
|
|
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
|
|
|
</Found>
|
|
|
|
<NotFound>
|
|
|
|
<CascadingAuthenticationState>
|
|
|
|
<LayoutView Layout="@typeof(Layout.MainLayout)">
|
2024-06-24 01:40:24 +00:00
|
|
|
<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>
|
2024-05-31 13:16:09 +00:00
|
|
|
</LayoutView>
|
|
|
|
</CascadingAuthenticationState>
|
|
|
|
</NotFound>
|
2024-05-30 01:06:08 +00:00
|
|
|
</Router>
|
2024-06-14 07:20:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
{
|
|
|
|
protected override void OnAfterRender(bool firstRender) {
|
|
|
|
string? shareString = Preferences.Get("shareString", null);
|
|
|
|
if (!string.IsNullOrWhiteSpace(shareString)) {
|
|
|
|
Preferences.Remove("shareString");
|
|
|
|
navigationManager.NavigateTo($"/sharetext/{shareString}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|