Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu refactoring #429

Merged
merged 2 commits into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");

}