mirror of
https://gh-proxy.org/https://github.com/tiajinsha/JKVideo
synced 2026-07-07 23:18:38 +08:00
- expo-image 替换 RN Image(VideoCard/LiveCard/BigVideoCard/CommentItem,recyclingKey) - DanmakuList Animated.Value 对象池,减少 GC 压力 - FlatList 性能参数:windowSize=7 / maxToRenderPerBatch=6 / removeClippedSubviews - bilibili.ts 请求去重(getVideoDetail/getPlayUrl) - SESSDATA 迁移至 expo-secure-store(utils/secureStorage.ts,启动自动迁移) - 主题系统扩展:新增 sheetBg/modalBg/modalText/placeholder/iconDefault/danger 等 token - 多组件深色模式适配:DownloadSheet/LivePlayer/NativeVideoPlayer/DownloadProgressBtn/CommentItem/LoginModal - 搜索页增强:搜索建议 + 热搜榜(hooks/useSearch.ts + app/search.tsx) - LoginModal 修复轮询竞态(cancelled flag + try-catch) - 修复 downloads.tsx 冗余三元表达式
58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
import { useSettingsStore } from '../store/settingsStore';
|
|
|
|
export type ThemeColors = {
|
|
bg: string; // 页面/列表背景
|
|
card: string; // 卡片/section 背景
|
|
text: string; // 主文字
|
|
textSub: string; // 次要文字
|
|
border: string; // 分割线
|
|
inputBg: string; // 输入框背景
|
|
sheetBg: string; // 底部弹出面板背景
|
|
modalBg: string; // 弹窗/面板背景
|
|
modalText: string; // 弹窗主文字
|
|
modalTextSub: string; // 弹窗次要文字
|
|
modalBorder: string; // 弹窗分割线
|
|
placeholder: string; // 占位背景(图片加载中)
|
|
iconDefault: string; // 默认图标色
|
|
danger: string; // 危险操作色
|
|
};
|
|
|
|
const light: ThemeColors = {
|
|
bg: '#f4f4f4',
|
|
card: '#fff',
|
|
text: '#212121',
|
|
textSub: '#999',
|
|
border: '#eee',
|
|
inputBg: '#f0f0f0',
|
|
sheetBg: '#fff',
|
|
modalBg: '#fff',
|
|
modalText: '#212121',
|
|
modalTextSub: '#555',
|
|
modalBorder: '#eee',
|
|
placeholder: '#ddd',
|
|
iconDefault: '#999',
|
|
danger: '#ff4757',
|
|
};
|
|
|
|
const dark: ThemeColors = {
|
|
bg: '#0f0f0f',
|
|
card: '#1a1a1a',
|
|
text: '#e0e0e0',
|
|
textSub: '#666',
|
|
border: '#2a2a2a',
|
|
inputBg: '#2a2a2a',
|
|
sheetBg: '#222',
|
|
modalBg: '#2a2a2a',
|
|
modalText: '#e0e0e0',
|
|
modalTextSub: '#888',
|
|
modalBorder: '#3a3a3a',
|
|
placeholder: '#333',
|
|
iconDefault: '#777',
|
|
danger: '#ff6b81',
|
|
};
|
|
|
|
export function useTheme(): ThemeColors {
|
|
const darkMode = useSettingsStore(s => s.darkMode);
|
|
return darkMode ? dark : light;
|
|
}
|