refactor(sidebar): merge balance and user into unified card
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -210,21 +210,22 @@ export default function Sidebar({ currentPath, onNavigate }: SidebarProps) {
|
||||
</div>
|
||||
)}
|
||||
<div className="sidebar-footer" ref={menuRef}>
|
||||
<div
|
||||
className="sidebar-balance"
|
||||
onClick={() => onNavigate('profile')}
|
||||
title="查看账户"
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#36b26a" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />
|
||||
</svg>
|
||||
<span className="balance-text">{balance} 积分</span>
|
||||
</div>
|
||||
<div
|
||||
className="sidebar-user"
|
||||
onClick={() => setShowUserMenu(!showUserMenu)}
|
||||
title="菜单"
|
||||
>
|
||||
<div className="sidebar-footer-card">
|
||||
<div
|
||||
className="sidebar-balance"
|
||||
onClick={() => onNavigate('profile')}
|
||||
title="查看账户"
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#36b26a" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />
|
||||
</svg>
|
||||
<span className="balance-text">{balance} 积分</span>
|
||||
</div>
|
||||
<div
|
||||
className="sidebar-user"
|
||||
onClick={() => setShowUserMenu(!showUserMenu)}
|
||||
title="菜单"
|
||||
>
|
||||
<img
|
||||
src={authUser?.avatar || '/default-avatar.svg'}
|
||||
alt="avatar"
|
||||
@@ -248,6 +249,7 @@ export default function Sidebar({ currentPath, onNavigate }: SidebarProps) {
|
||||
<polyline points="9 18 15 12 9 6" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
{showUserMenu && (
|
||||
<div className="user-dropdown-menu">
|
||||
{userMenuItems.map((item) => (
|
||||
|
||||
Reference in New Issue
Block a user