From 538cb1a367a202261a265a5fef638ea55d1a0ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B1=BC=E5=BC=80=E5=8F=91?= Date: Fri, 22 May 2026 15:22:50 +0800 Subject: [PATCH] refactor(sidebar): merge balance and user into unified card --- tauri-app/src/components/Layout/Sidebar.css | 12 +++++--- tauri-app/src/components/Layout/Sidebar.tsx | 32 +++++++++++---------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/tauri-app/src/components/Layout/Sidebar.css b/tauri-app/src/components/Layout/Sidebar.css index ac01d80..7b71cf3 100644 --- a/tauri-app/src/components/Layout/Sidebar.css +++ b/tauri-app/src/components/Layout/Sidebar.css @@ -167,17 +167,22 @@ position: relative; } +.sidebar-footer-card { + background: var(--bg-card); + border: 1px solid var(--border-light); + border-radius: var(--radius-lg); + overflow: hidden; +} + .sidebar-balance { display: flex; align-items: center; justify-content: center; gap: var(--spacing-xs); padding: var(--spacing-xs) var(--spacing-sm); - border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition-fast); - background: var(--bg-card); - border: 1px solid var(--border-light); + border-bottom: 1px solid var(--border-light); } .sidebar-balance:hover { @@ -196,7 +201,6 @@ justify-content: center; gap: var(--spacing-sm); padding: var(--spacing-sm); - border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition-fast); } diff --git a/tauri-app/src/components/Layout/Sidebar.tsx b/tauri-app/src/components/Layout/Sidebar.tsx index a100634..09cf686 100644 --- a/tauri-app/src/components/Layout/Sidebar.tsx +++ b/tauri-app/src/components/Layout/Sidebar.tsx @@ -210,21 +210,22 @@ export default function Sidebar({ currentPath, onNavigate }: SidebarProps) { )}
-
onNavigate('profile')} - title="查看账户" - > - - - - {balance} 积分 -
-
setShowUserMenu(!showUserMenu)} - title="菜单" - > +
+
onNavigate('profile')} + title="查看账户" + > + + + + {balance} 积分 +
+
setShowUserMenu(!showUserMenu)} + title="菜单" + > avatar
+
{showUserMenu && (
{userMenuItems.map((item) => (