From e4bc1b9bbe59dcb2833dab44c9adf3c22420207b Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Sat, 25 Apr 2026 02:23:10 +0800 Subject: [PATCH] Refactor frontend styles toward Tailwind utilities and unified design system --- webapp/src/App.tsx | 3 + .../src/components/AppAuthenticatedShell.tsx | 3 +- webapp/src/components/AppGlobalOverlays.tsx | 2 +- webapp/src/components/AppMainRoutes.tsx | 3 + webapp/src/components/PublicSendPage.tsx | 86 ++- webapp/src/components/SecurityDevicesPage.tsx | 8 +- webapp/src/components/SendsPage.tsx | 21 +- webapp/src/components/SettingsPage.tsx | 35 +- webapp/src/components/VaultPage.tsx | 10 +- .../src/components/vault/VaultDetailView.tsx | 4 +- webapp/src/components/vault/VaultEditor.tsx | 2 +- webapp/src/lib/api/send.ts | 29 +- webapp/src/styles/auth.css | 72 +-- webapp/src/styles/base.css | 4 +- webapp/src/styles/forms.css | 33 +- webapp/src/styles/management.css | 550 ++++++------------ webapp/src/styles/overlays.css | 137 +---- webapp/src/styles/responsive.css | 244 +++----- webapp/src/styles/shell.css | 54 +- webapp/src/styles/vault.css | 509 ++++++---------- 20 files changed, 632 insertions(+), 1177 deletions(-) diff --git a/webapp/src/App.tsx b/webapp/src/App.tsx index 5f3956d..905fa08 100644 --- a/webapp/src/App.tsx +++ b/webapp/src/App.tsx @@ -155,6 +155,7 @@ export default function App() { const [confirm, setConfirm] = useState(null); const [mobileLayout, setMobileLayout] = useState(false); + const [mobileSidebarToggleKey, setMobileSidebarToggleKey] = useState(0); const [decryptedFolders, setDecryptedFolders] = useState([]); const [decryptedCiphers, setDecryptedCiphers] = useState([]); const [decryptedSends, setDecryptedSends] = useState([]); @@ -1198,6 +1199,7 @@ export default function App() { profile, session, mobileLayout, + mobileSidebarToggleKey, importRoute: IMPORT_ROUTE, settingsHomeRoute: SETTINGS_HOME_ROUTE, settingsAccountRoute: SETTINGS_ACCOUNT_ROUTE, @@ -1403,6 +1405,7 @@ export default function App() { onLock={handleLock} onLogout={handleLogout} onToggleTheme={handleToggleTheme} + onToggleMobileSidebar={() => setMobileSidebarToggleKey((key) => key + 1)} mainRoutesProps={mainRoutesProps} /> diff --git a/webapp/src/components/AppAuthenticatedShell.tsx b/webapp/src/components/AppAuthenticatedShell.tsx index da7e4b0..e5fa988 100644 --- a/webapp/src/components/AppAuthenticatedShell.tsx +++ b/webapp/src/components/AppAuthenticatedShell.tsx @@ -21,6 +21,7 @@ interface AppAuthenticatedShellProps { onLock: () => void; onLogout: () => void; onToggleTheme: () => void; + onToggleMobileSidebar: () => void; mainRoutesProps: AppMainRoutesProps; } @@ -51,7 +52,7 @@ export default function AppAuthenticatedShell(props: AppAuthenticatedShellProps) className="btn btn-secondary small mobile-sidebar-toggle" aria-label={props.sidebarToggleTitle} title={props.sidebarToggleTitle} - onClick={() => window.dispatchEvent(new CustomEvent('nodewarden:toggle-sidebar'))} + onClick={props.onToggleMobileSidebar} > diff --git a/webapp/src/components/AppGlobalOverlays.tsx b/webapp/src/components/AppGlobalOverlays.tsx index e6f8ab8..becbd6e 100644 --- a/webapp/src/components/AppGlobalOverlays.tsx +++ b/webapp/src/components/AppGlobalOverlays.tsx @@ -76,7 +76,7 @@ export default function AppGlobalOverlays(props: AppGlobalOverlaysProps) { {t('txt_totp_code')} props.onTotpCodeChange((e.currentTarget as HTMLInputElement).value)} /> -