Admin portal: mobile-friendly layout + nav drawer
app.css:
- New .sor-admin-outer wrapper (flex column, 100vh) so topbar + shell stack vertically
- .sor-admin-shell changed from height:100vh to flex:1 (fills remaining space)
- .sor-admin-topbar: hidden on desktop (display:none), shown at <992px as a 56px
dark strip hosting the hamburger button and brand
- .sor-admin-sidebar: at <992px becomes a fixed overlay drawer (position:fixed,
translateX(-100%)), slides in with .open class (0.25s ease-in-out transition)
- .sor-admin-backdrop: full-screen dim overlay (z-index 1040), hidden on desktop
- Minor: tighter container-fluid padding on small screens
MainLayout.razor:
- Wrapped authorized shell in .sor-admin-outer
- Added mobile topbar with hamburger (<i class="bi bi-list">) + brand
- Added backdrop div rendered conditionally when _drawerOpen
- Drawer state (_drawerOpen bool) managed here; toggled by hamburger, closed
by backdrop click and automatically on any NavigationManager.LocationChanged
- Implements IDisposable to unsubscribe LocationChanged event handler
- Passes IsOpen parameter to NavMenu
NavMenu.razor:
- Added [Parameter] public bool IsOpen { get; set; }
- Applies "open" CSS class to <nav> when IsOpen is true
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
@inject IJSRuntime Js
|
||||
|
||||
<nav class="sor-admin-sidebar d-flex flex-column bg-dark text-white p-3">
|
||||
<nav class="sor-admin-sidebar d-flex flex-column bg-dark text-white p-3 @(IsOpen ? "open" : "")">
|
||||
<a class="navbar-brand text-white fw-bold fs-5 mb-4 text-decoration-none" href="/">
|
||||
<i class="bi bi-lightning-charge-fill text-warning me-2"></i>SOR Admin
|
||||
</a>
|
||||
@@ -138,6 +138,8 @@
|
||||
</nav>
|
||||
|
||||
@code {
|
||||
[Parameter] public bool IsOpen { get; set; }
|
||||
|
||||
private string _theme = "light";
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
|
||||
Reference in New Issue
Block a user