({
activeTab = 'home', // 'home' | 'detail' | 'settings'
// Sort props
isSortMenuOpen,
setIsSortMenuOpen,
sortOrder,
setSortOrder,
setRandomSeed,
// Actions
onRefresh,
// I18n
language,
setLanguage,
// Theme
isDarkMode,
themeMode,
setThemeMode,
t
})
| 24 | * Sidebar 组件 - 通用侧边导航栏 |
| 25 | */ |
| 26 | export const Sidebar = ({ |
| 27 | activeTab = 'home', // 'home' | 'detail' | 'settings' |
| 28 | // Sort props |
| 29 | isSortMenuOpen, |
| 30 | setIsSortMenuOpen, |
| 31 | sortOrder, |
| 32 | setSortOrder, |
| 33 | setRandomSeed, |
| 34 | // Actions |
| 35 | onRefresh, |
| 36 | // I18n |
| 37 | language, |
| 38 | setLanguage, |
| 39 | // Theme |
| 40 | isDarkMode, |
| 41 | themeMode, |
| 42 | setThemeMode, |
| 43 | t |
| 44 | }) => { |
| 45 | const location = useLocation(); |
| 46 | // const [isSponsorModalOpen, setIsSponsorModalOpen] = useState(false); |
| 47 | // 统一的容器样式 |
| 48 | // TODO: 渐变填充和描边暂时设为透明,保留结构以便后续调整 |
| 49 | const containerStyle = isDarkMode ? { |
| 50 | width: '62px', |
| 51 | height: '100%', |
| 52 | borderRadius: '16px', |
| 53 | border: '1px solid transparent', |
| 54 | background: 'transparent', |
| 55 | // 原渐变样式 (暂时禁用) |
| 56 | // backgroundImage: 'linear-gradient(180deg, #3B3B3B 0%, #242120 100%), linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%)', |
| 57 | // backgroundOrigin: 'border-box', |
| 58 | // backgroundClip: 'padding-box, border-box', |
| 59 | } : { |
| 60 | width: '62px', |
| 61 | height: '100%', |
| 62 | borderRadius: '16px', |
| 63 | border: '1px solid transparent', |
| 64 | background: 'transparent', |
| 65 | }; |
| 66 | |
| 67 | return ( |
| 68 | <aside |
| 69 | style={containerStyle} |
| 70 | className="relative flex flex-col justify-between items-center py-1 mr-4 flex-shrink-0" |
| 71 | > |
| 72 | {/* 上部分:Logo + 导航按钮 */} |
| 73 | <div className="flex flex-col items-center gap-5 w-full"> |
| 74 | {/* Logo */} |
| 75 | <div> |
| 76 | <img src="/Logo_icon.svg" alt="提示词填空器 (Prompt Fill) - AI 提示词管理工具" className="w-9 h-9" /> |
| 77 | </div> |
| 78 | |
| 79 | {/* 导航按钮组 */} |
| 80 | <div className="flex flex-col items-center gap-4"> |
| 81 | <Tooltip content="主页" isDarkMode={isDarkMode}> |
| 82 | <Link |
| 83 | to="/explore" |
nothing calls this directly
no test coverage detected