2023-02-11 22:04:02 +00:00
|
|
|
@using ImageBoardServerApp.Auth
|
|
|
|
@inject AuthenticationStateProvider authStateProvider
|
|
|
|
@inject NavigationManager navManager
|
|
|
|
|
|
|
|
<div class="top-row ps-3 navbar navbar-dark">
|
2023-01-18 12:56:24 +00:00
|
|
|
<div class="container-fluid">
|
|
|
|
<a class="navbar-brand" href="">ImageBoard</a>
|
2023-02-11 22:04:02 +00:00
|
|
|
<AuthorizeView>
|
|
|
|
<Authorized>
|
|
|
|
<a class="navbar-brand" @onclick="logout" href="javascript:void(0)">[Logout]</a>
|
|
|
|
</Authorized>
|
|
|
|
<NotAuthorized>
|
2023-02-12 16:01:46 +00:00
|
|
|
<a class="navbar-brand" href="/sys/login">[Login]</a>
|
2023-02-11 22:04:02 +00:00
|
|
|
</NotAuthorized>
|
|
|
|
</AuthorizeView>
|
2023-01-18 12:56:24 +00:00
|
|
|
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
|
|
|
|
<span class="navbar-toggler-icon"></span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
|
|
|
|
<nav class="flex-column">
|
|
|
|
<div class="nav-item px-3">
|
|
|
|
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
|
|
|
<span class="oi oi-home" aria-hidden="true"></span> Home
|
|
|
|
</NavLink>
|
|
|
|
</div>
|
|
|
|
<div class="nav-item px-3">
|
2023-02-08 13:43:25 +00:00
|
|
|
<NavLink class="nav-link" href="m">
|
|
|
|
<span class="oi oi-list-rich" aria-hidden="true"></span> /m/ - Main
|
2023-01-18 12:56:24 +00:00
|
|
|
</NavLink>
|
|
|
|
</div>
|
2023-02-11 22:04:02 +00:00
|
|
|
<div class="nav-item px-3">
|
|
|
|
<NavLink class="nav-link" href="tec">
|
|
|
|
<span class="oi oi-list-rich" aria-hidden="true"></span> /tec/ - Technology
|
|
|
|
</NavLink>
|
|
|
|
</div>
|
|
|
|
<div class="nav-item px-3">
|
|
|
|
<NavLink class="nav-link" href="art">
|
|
|
|
<span class="oi oi-list-rich" aria-hidden="true"></span> /art/ - Art
|
|
|
|
</NavLink>
|
|
|
|
</div>
|
|
|
|
<div class="nav-item px-3">
|
|
|
|
<NavLink class="nav-link" href="vg">
|
|
|
|
<span class="oi oi-list-rich" aria-hidden="true"></span> /vg/ - Video Games
|
|
|
|
</NavLink>
|
|
|
|
</div>
|
2023-01-18 12:56:24 +00:00
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@code {
|
|
|
|
private bool collapseNavMenu = true;
|
|
|
|
|
|
|
|
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
|
|
|
|
|
|
|
private void ToggleNavMenu()
|
|
|
|
{
|
|
|
|
collapseNavMenu = !collapseNavMenu;
|
|
|
|
}
|
2023-02-11 22:04:02 +00:00
|
|
|
|
|
|
|
private async Task logout()
|
|
|
|
{
|
|
|
|
var customAuthStateProvider = (CustomAuthenticationStateProvider) authStateProvider;
|
|
|
|
await customAuthStateProvider.UpdateAuthenticationStateAsync(null);
|
|
|
|
navManager.NavigateTo("/", true);
|
|
|
|
}
|
2023-01-18 12:56:24 +00:00
|
|
|
}
|