Skip to content

Commit a696293

Browse files
committed
integrated radzen components
1 parent 5cbcf59 commit a696293

16 files changed

+72
-289
lines changed

src/Client/Logistics.AdminAppWasm/App.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<CascadingAuthenticationState>
1+
<CascadingAuthenticationState>
22
<Router AppAssembly="@typeof(App).Assembly">
33
<Found Context="routeData">
44
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">

src/Client/Logistics.AdminAppWasm/Extensions/ApplicationExtensions.cs

-33
This file was deleted.

src/Client/Logistics.AdminAppWasm/Layout/LoginDisplay.razor

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
1+
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
22
@inject NavigationManager Navigation
33

4-
<AuthorizeView>
5-
<Authorized>
6-
Hello, @context.User.Identity?.Name
7-
<button class="nav-link btn btn-link" @onclick="BeginLogOut">Log out</button>
8-
</Authorized>
9-
<NotAuthorized>
10-
<a href="authentication/login">Log in</a>
11-
</NotAuthorized>
12-
</AuthorizeView>
4+
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
5+
<AuthorizeView>
6+
<Authorized>
7+
<RadzenLink Icon="account_circle">@context.User.Identity?.Name</RadzenLink>
8+
<RadzenLink Icon="login" Path="authentication/logout">Sign Out</RadzenLink>
9+
</Authorized>
10+
<NotAuthorized>
11+
<RadzenLink Icon="login" Path="authentication/login">Sign In</RadzenLink>
12+
</NotAuthorized>
13+
</AuthorizeView>
14+
</RadzenStack>
1315

1416
@code {
1517
private void BeginLogOut()
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,45 @@
1-
@inherits LayoutComponentBase
1+
@inherits LayoutComponentBase
22

33
<PageTitle>Logistics Admin</PageTitle>
44
<Toast @ref="_toastRef" ToastPosition="Toast.Position.BottomRight"></Toast>
55

6-
<div class="page">
7-
<div class="sidebar">
8-
<NavMenu/>
9-
</div>
10-
11-
<main>
12-
<div class="top-row px-4 auth">
13-
<LoginDisplay/>
14-
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
15-
</div>
16-
17-
<article class="content px-4">
6+
<RadzenLayout>
7+
<RadzenHeader>
8+
<RadzenRow>
9+
<RadzenColumn Size="2">
10+
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0.5rem">
11+
<RadzenSidebarToggle Click="@(() => _sidebarExpanded = !_sidebarExpanded)"/>
12+
<RadzenLabel Text="Logistics Admin"/>
13+
</RadzenStack>
14+
</RadzenColumn>
15+
<RadzenColumn Size="2" Offset="8" class="d-flex justify-content-end pe-2">
16+
<LoginDisplay/>
17+
</RadzenColumn>
18+
</RadzenRow>
19+
20+
</RadzenHeader>
21+
<RadzenSidebar @bind-Expanded="@_sidebarExpanded">
22+
<RadzenPanelMenu>
23+
<RadzenPanelMenuItem Text="Home" Icon="home" Path="/" />
24+
<RadzenPanelMenuItem Text="Tenants" Icon="home" Path="/tenants" />
25+
<RadzenPanelMenuItem Text="Subscriptions" Icon="subscriptions" />
26+
<RadzenPanelMenuItem Text="Users" Icon="subscriptions" />
27+
</RadzenPanelMenu>
28+
</RadzenSidebar>
29+
<RadzenBody>
30+
<div class="rz-p-4">
1831
<Alert @ref="_alertRef" />
1932
<CascadingValue Value="_toastRef">
2033
<CascadingValue Value="_alertRef">
2134
@Body
2235
</CascadingValue>
2336
</CascadingValue>
24-
</article>
25-
</main>
26-
</div>
37+
</div>
38+
</RadzenBody>
39+
</RadzenLayout>
2740

2841
@code {
42+
private bool _sidebarExpanded = true;
2943
private Toast? _toastRef;
3044
private Alert? _alertRef;
3145
}

src/Client/Logistics.AdminAppWasm/Layout/MainLayout.razor.css

-77
This file was deleted.

src/Client/Logistics.AdminAppWasm/Layout/NavMenu.razor

-54
This file was deleted.

src/Client/Logistics.AdminAppWasm/Layout/NavMenu.razor.css

-83
This file was deleted.

src/Client/Logistics.AdminAppWasm/Logistics.AdminAppWasm.csproj

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@
1111
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0"/>
1212
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all"/>
1313
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.0"/>
14+
<PackageReference Include="Radzen.Blazor" Version="4.22.1" />
1415
</ItemGroup>
1516

1617
<ItemGroup>
1718
<ProjectReference Include="..\Logistics.BlazorComponents\Logistics.BlazorComponents.csproj" />
1819
<ProjectReference Include="..\Logistics.Client\Logistics.Client.csproj" />
1920
</ItemGroup>
20-
21-
<ItemGroup>
22-
<_ContentIncludedByDefault Remove="wwwroot\sample-data\weather.json" />
23-
</ItemGroup>
24-
2521
</Project>

src/Client/Logistics.AdminAppWasm/Pages/Authentication.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@page "/authentication/{action}"
1+
@page "/authentication/{action}"
22
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
33
<RemoteAuthenticatorView Action="@Action"/>
44

src/Client/Logistics.AdminAppWasm/Pages/Home.razor

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
@page "/"
1+
@page "/"
22
@attribute [Authorize]
33

44
<PageTitle>Logistics Admin</PageTitle>
5-
6-
<h1>Site Administration</h1>
5+
<RadzenText TextStyle="TextStyle.H3">Dashboard</RadzenText>
76

87
<table class="table table-hover">
98
<thead>

src/Client/Logistics.AdminAppWasm/Pages/Tenant/EditTenant.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@page "/edit-tenant/{id?}"
1+
@page "/tenants/{id?}"
22
@inherits PageBase
33

44
@{

src/Client/Logistics.AdminAppWasm/Pages/Tenant/ListTenant.razor src/Client/Logistics.AdminAppWasm/Pages/Tenant/ListTenants.razor

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
@page "/list-tenant"
1+
@page "/tenants"
22
@using Logistics.Shared.Models
3+
@using TextAlign = Logistics.BlazorComponents.Grids.TextAlign
34
@inherits PageBase
45

56
<h2>Tenants List</h2>

0 commit comments

Comments
 (0)