From a7bb8d7149c2fe62b4b3859e382a9c20766534fc Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 28 Jun 2026 20:58:51 +0900 Subject: [PATCH] fix(admin): remove drawer footer info and close on mobile --- .../Components/Admin/Layout/MainLayout.razor | 28 +++++++------------ TaxBaik.Web/wwwroot/js/admin-session.js | 4 +++ 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/TaxBaik.Web/Components/Admin/Layout/MainLayout.razor b/TaxBaik.Web/Components/Admin/Layout/MainLayout.razor index a12f336..ece20a4 100644 --- a/TaxBaik.Web/Components/Admin/Layout/MainLayout.razor +++ b/TaxBaik.Web/Components/Admin/Layout/MainLayout.razor @@ -83,24 +83,6 @@ 문의 관리 설정 - @@ -121,6 +103,16 @@ Navigation.LocationChanged += OnLocationChanged; } + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (!firstRender) + return; + + var viewportWidth = await JS.InvokeAsync("taxbaikAdminSession.getViewportWidth"); + drawerOpen = viewportWidth >= 960; + StateHasChanged(); + } + private void OnLocationChanged(object? sender, LocationChangedEventArgs args) { _ = InvokeAsync(() => JS.InvokeVoidAsync("taxbaikAdminSession.showLoading")); diff --git a/TaxBaik.Web/wwwroot/js/admin-session.js b/TaxBaik.Web/wwwroot/js/admin-session.js index 34a3cee..7407bd0 100644 --- a/TaxBaik.Web/wwwroot/js/admin-session.js +++ b/TaxBaik.Web/wwwroot/js/admin-session.js @@ -5,6 +5,10 @@ window.taxbaikAdminSession = { window.location.pathname.toLowerCase().endsWith('/admin/login')); }, + getViewportWidth: function () { + return window.innerWidth || document.documentElement.clientWidth || 0; + }, + clearAuthToken: function () { try { localStorage.removeItem('auth_token');