42 lines
No EOL
1.6 KiB
Text
42 lines
No EOL
1.6 KiB
Text
@inject NavigationManager Navigation
|
|
@using Blazored.LocalStorage
|
|
@inject ILocalStorageService localStorage
|
|
@inject APIService api
|
|
|
|
<FluentHeader>
|
|
<div style="display: flex; justify-content: space-between; flex-direction: row; align-items: center; width: 100%;">
|
|
<div>
|
|
Blazing Console
|
|
</div>
|
|
@if (Linked != null) {
|
|
<FluentProfileMenu
|
|
Image="@Linked.AvatarUrl()" FullName="@Linked.Username"
|
|
EMail="Blazing Console"
|
|
><HeaderTemplate /><FooterTemplate>
|
|
<FluentStack Orientation="Orientation.Horizontal" VerticalAlignment="VerticalAlignment.Center">
|
|
<FluentAnchor Href="#" OnClick="Logout" Appearance="Appearance.Hypertext">Logout</FluentAnchor>
|
|
<FluentLabel Color="Color.Accent">·</FluentLabel>
|
|
<FluentAnchor Href="/settings" Appearance="Appearance.Hypertext">Settings</FluentAnchor>
|
|
<FluentLabel Color="Color.Accent">·</FluentLabel>
|
|
<FluentAnchor Href="/about" Appearance="Appearance.Hypertext">About</FluentAnchor>
|
|
</FluentStack>
|
|
</FooterTemplate></FluentProfileMenu>
|
|
} else {
|
|
<FluentProgressRing />
|
|
}
|
|
</div>
|
|
</FluentHeader>
|
|
|
|
@code {
|
|
public LinkedUser? Linked { get; set; } = null;
|
|
|
|
protected override Task OnInitializedAsync() {
|
|
Linked = api.GetLinkedUser();
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public async Task Logout() {
|
|
await localStorage.RemoveItemAsync("jwt");
|
|
Navigation.NavigateTo("/login");
|
|
}
|
|
} |