Skip to content

Commit

Permalink
NavMenu refactoring
Browse files Browse the repository at this point in the history
Co-authored-by: crib <[email protected]>
  • Loading branch information
ChristopheRib63 and crib authored Mar 10, 2022
1 parent 5374e17 commit f46f6cc
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/AzureIoTHub.Portal/Client/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
@using AzureIoTHub.Portal.Shared.Security;
@using Microsoft.AspNetCore.Components.Authorization
@inject NavigationManager navigationManager

<AuthorizeView>
<Authorized>
<MudNavMenu>
<MudText Typo="Typo.subtitle2" Color="Color.Inherit" Class="ml-4 my-3">Devices</MudText>
<MudNavLink Href="/devices">List</MudNavLink>
<MudPaper Class="d-flex align-center flex-grow-1 gap-4" Elevation="0">
<MudPaper Class="py-4 d-flex flex-1 mud-theme-primary"/><MudNavLink Href="/devices">Device List</MudNavLink>
<MudPaper Class="py-4 d-flex flex-1 mud-theme-secondary"/><MudIconButton OnClick="AddDevice" Color="Color.Secondary" Icon="@Icons.Material.Filled.AddCircle" Size="Size.Small"/>
</MudPaper>

<MudPaper Class="d-flex align-center flex-grow-1 gap-4" Elevation="0">
<MudPaper Class="py-4 d-flex flex-1 mud-theme-primary"/><MudNavLink Href="/device-models">Device Models</MudNavLink>
<MudPaper Class="py-4 d-flex flex-1 mud-theme-secondary"/><MudIconButton OnClick="AddDeviceModel" Color="Color.Secondary" Icon="@Icons.Material.Filled.AddCircle" Size="Size.Small"/>
</MudPaper>

<MudText Typo="Typo.subtitle2" Color="Color.Inherit" Class="ml-4 my-3">IoT Edge</MudText>

Expand All @@ -17,10 +26,7 @@
<MudText Typo="Typo.subtitle2" Color="Color.Inherit" Class="ml-4 my-3">LoRaWAN Management</MudText>
<MudNavLink Href="/lorawan/concentrators">Concentrators</MudNavLink>
}

<MudText Typo="Typo.subtitle2" Color="Color.Inherit" Class="ml-4 my-3">Device Models</MudText>
<MudNavLink Href="/device-models">List</MudNavLink>


<MudText Typo="Typo.subtitle2" Color="Color.Inherit" Class="ml-4 my-3">Settings</MudText>
<MudNavLink Href="/settings/device-tag">Device Tags</MudNavLink>

Expand All @@ -31,4 +37,8 @@
@code {
[Parameter]
public bool activateLoRaFeature { get; set; }

private void AddDevice() => navigationManager.NavigateTo("devices/new");
private void AddDeviceModel() => navigationManager.NavigateTo("/device-models/new");

}

0 comments on commit f46f6cc

Please sign in to comment.