72 lines
3.0 KiB
Plaintext
72 lines
3.0 KiB
Plaintext
<div class="container animated-navbar @(IsVisible ? "show-nav" : "hide-nav") @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
|
||
<nav class="navbar @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
|
||
<div class="container-navbar">
|
||
<ul class="navbar-nav flex-row nav-justified align-items-center w-100 text-center">
|
||
<li class="nav-item">
|
||
<NavLink class="nav-link" href="Users" Match="NavLinkMatch.All">
|
||
<div class="d-flex flex-column">
|
||
<i class="ri-group-line"></i>
|
||
<span>Test</span>
|
||
</div>
|
||
</NavLink>
|
||
</li>
|
||
<li class="nav-item">
|
||
<NavLink class="nav-link" href="home" Match="NavLinkMatch.All">
|
||
<div class="d-flex flex-column">
|
||
<i class="ri-calendar-todo-line"></i>
|
||
<span>Home</span>
|
||
</div>
|
||
</NavLink>
|
||
</li>
|
||
<li class="nav-item">
|
||
<NavLink class="nav-link" href="Calendar" Match="NavLinkMatch.All">
|
||
<div class="d-flex flex-column">
|
||
<i class="ri-calendar-todo-line"></i>
|
||
<span>Altro</span>
|
||
</div>
|
||
</NavLink>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
|
||
@if (PlusVisible)
|
||
{
|
||
<MudMenu PopoverClass="custom_popover" AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomRight">
|
||
<ActivatorContent>
|
||
<MudFab Class="custom-plus-button" Color="Color.Surface" Size="Size.Medium" IconSize="Size.Medium" IconColor="Color.Primary" StartIcon="@Icons.Material.Filled.Add"/>
|
||
</ActivatorContent>
|
||
<ChildContent>
|
||
@* <MudMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="() => CreateUser()">Nuovo contatto</MudMenuItem> *@
|
||
@* <MudMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="() => CreateActivity()">Nuova attivit<69></MudMenuItem> *@
|
||
</ChildContent>
|
||
</MudMenu>
|
||
}
|
||
</nav>
|
||
</div>
|
||
|
||
@code
|
||
{
|
||
private bool IsVisible { get; set; } = true;
|
||
private bool PlusVisible { get; set; } = true;
|
||
|
||
protected override Task OnInitializedAsync()
|
||
{
|
||
NavigationManager.LocationChanged += (_, args) =>
|
||
{
|
||
var location = args.Location.Remove(0, NavigationManager.BaseUri.Length);
|
||
|
||
var newIsVisible = new List<string> { "home" }
|
||
.Contains(location);
|
||
|
||
var newPlusVisible = new List<string> { }
|
||
.Contains(location);
|
||
|
||
if (IsVisible == newIsVisible && PlusVisible == newPlusVisible) return;
|
||
|
||
IsVisible = newIsVisible;
|
||
PlusVisible = newPlusVisible;
|
||
StateHasChanged();
|
||
};
|
||
return Task.CompletedTask;
|
||
}
|
||
} |