refactor(stores): reorganize flat store files into modular directory structure
Migrate from flat file organization to modular directory structure under src/stores/: - auth/: authStore, registerStore, verificationStore, sessionStore - call/: callStore - settings/: chatSettingsStore, themeStore - ui/: homeTabBarVisibilityStore, homeTabPressStore - utils/: routePayloadCache - group/sources.ts, group/profileResolver.ts - message/sources.ts - post/sources.ts Update all import paths across components and screens to use new module paths. Maintain backward compatibility through deprecated re-export files for gradual migration.
This commit is contained in:
12
src/stores/ui/homeTabBarVisibilityStore.ts
Normal file
12
src/stores/ui/homeTabBarVisibilityStore.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface HomeTabBarVisibilityState {
|
||||
/** 首页列表下滑时隐藏底部 Tab,上滑或闲置后恢复 */
|
||||
bottomTabBarHiddenByScroll: boolean;
|
||||
setBottomTabBarHiddenByScroll: (hidden: boolean) => void;
|
||||
}
|
||||
|
||||
export const useHomeTabBarVisibilityStore = create<HomeTabBarVisibilityState>((set) => ({
|
||||
bottomTabBarHiddenByScroll: false,
|
||||
setBottomTabBarHiddenByScroll: (hidden) => set({ bottomTabBarHiddenByScroll: hidden }),
|
||||
}));
|
||||
13
src/stores/ui/homeTabPressStore.ts
Normal file
13
src/stores/ui/homeTabPressStore.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface HomeTabPressState {
|
||||
/** 用于触发首页回到顶部的事件计数器 */
|
||||
pressCount: number;
|
||||
/** 触发首页 Tab 点击事件 */
|
||||
triggerPress: () => void;
|
||||
}
|
||||
|
||||
export const useHomeTabPressStore = create<HomeTabPressState>((set) => ({
|
||||
pressCount: 0,
|
||||
triggerPress: () => set((state) => ({ pressCount: state.pressCount + 1 })),
|
||||
}));
|
||||
6
src/stores/ui/index.ts
Normal file
6
src/stores/ui/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* UI 状态模块统一导出
|
||||
*/
|
||||
|
||||
export { useHomeTabBarVisibilityStore } from './homeTabBarVisibilityStore';
|
||||
export { useHomeTabPressStore } from './homeTabPressStore';
|
||||
Reference in New Issue
Block a user