feature: 新增书架页组件与项目页新架构(书架视图、侧边栏折叠记忆、URL 视图参数切换)

This commit is contained in:
xiamuceer-j
2026-03-06 14:13:15 +08:00
parent f13dd26404
commit fc03fe958f
3 changed files with 1062 additions and 742 deletions
+28
View File
@@ -0,0 +1,28 @@
const SIDEBAR_COLLAPSED_STORAGE_KEY = 'mumu_sidebar_collapsed';
export const getStoredSidebarCollapsed = (): boolean => {
if (typeof window === 'undefined') {
return false;
}
try {
return localStorage.getItem(SIDEBAR_COLLAPSED_STORAGE_KEY) === '1';
} catch (error) {
console.warn('读取侧边栏状态失败:', error);
return false;
}
};
export const setStoredSidebarCollapsed = (collapsed: boolean): void => {
if (typeof window === 'undefined') {
return;
}
try {
localStorage.setItem(SIDEBAR_COLLAPSED_STORAGE_KEY, collapsed ? '1' : '0');
} catch (error) {
console.warn('保存侧边栏状态失败:', error);
}
};
export const getSidebarCollapsedStorageKey = (): string => SIDEBAR_COLLAPSED_STORAGE_KEY;