Compare commits

..

5 Commits

Author SHA1 Message Date
54bf84b19b feat: 首页更新 2025-11-13 16:47:10 +08:00
9ef9233797 feat: 首页更新 2025-11-12 00:13:26 +08:00
b48cce06f4 feat: 首页更新 2025-11-11 18:48:54 +08:00
230191f181 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	utils/config.ts
2025-11-07 15:04:20 +08:00
0f1f775605 feat: 添加.env.local配置 2025-11-07 15:03:00 +08:00
1267 changed files with 6379 additions and 1375 deletions

View File

@@ -301,17 +301,17 @@ rn-demo/
项目已安装并配置好以下工具库:
| 类别 | 工具库 | 用途 | 状态 |
| ------------ | ----------------------------------------- | ------------------- | ---- |
| **工具类** | lodash-es | JavaScript 工具函数 | ✅ |
| | dayjs | 日期处理 | ✅ |
| | axios | HTTP 请求 | ✅ |
| **状态管理** | zustand | 轻量级状态管理 | ✅ |
| **表单处理** | react-hook-form | 表单管理 | ✅ |
| | zod | 数据验证 | ✅ |
| **原生功能** | @react-native-async-storage/async-storage | 本地存储 | ✅ |
| | expo-image | 优化的图片组件 | ✅ |
| | expo-haptics | 触觉反馈 | ✅ |
| 类别 | 工具库 | 用途 | 状态 |
| ------------ | ----------------------------------------- | -------------------- | ---- |
| **工具类** | lodash-es | JavaScript 工具函数 | ✅ |
| | dayjs | 日期处理 | ✅ |
| | axios | HTTP 请求 | ✅ |
| **状态管理** | zustand | 轻量级状态管理 | ✅ |
| **表单处理** | react-hook-form | 表单管理 | ✅ |
| | zod | 数据验证 | ✅ |
| **原生功能** | @react-native-async-storage/async-storage | 本地存储 | ✅ |
| | expo-image | 优化的图片组件 | ✅ |
| | expo-haptics | 触觉反馈 | ✅ |
| **UI 组件** | react-native-paper | Material Design 组件 | ✅ |
### 快速开始
@@ -325,7 +325,13 @@ rn-demo/
import { Storage, SessionStorage, StorageManager, formatDate } from '@/utils';
import { useUser, useTheme, useLanguage } from '@/stores';
import { authService, userService } from '@/services';
import { useDebounce, useHaptics, useColorScheme, useThemeColors, useClientOnlyValue } from '@/hooks';
import {
useDebounce,
useHaptics,
useColorScheme,
useThemeColors,
useClientOnlyValue,
} from '@/hooks';
import { loginSchema } from '@/schemas';
// ✅ 主题系统:统一从 theme 目录导入 🎯 NEW!

View File

@@ -3,7 +3,7 @@ import FontAwesome from '@expo/vector-icons/FontAwesome';
import { Link, Tabs } from 'expo-router';
import { Pressable } from 'react-native';
import Colors from '@/constants/Colors';
import { Colors } from '@/theme';
import { useColorScheme, useClientOnlyValue } from '@/hooks';
// You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/
@@ -29,42 +29,28 @@ export default function TabLayout() {
<Tabs.Screen
name="index"
options={{
title: 'Tab One',
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
headerRight: () => (
<Link href="/modal" asChild>
<Pressable>
{({ pressed }) => (
<FontAwesome
name="info-circle"
size={25}
color={Colors[colorScheme ?? 'light'].text}
style={{ marginRight: 15, opacity: pressed ? 0.5 : 1 }}
/>
)}
</Pressable>
</Link>
),
title: '首页',
tabBarIcon: ({ color }) => <TabBarIcon name="home" color={color} />,
}}
/>
<Tabs.Screen
name="two"
options={{
title: 'Tab Two',
title: '充值',
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
}}
/>
<Tabs.Screen
name="demo"
options={{
title: '完整示例',
title: '活动',
tabBarIcon: ({ color }) => <TabBarIcon name="rocket" color={color} />,
}}
/>
<Tabs.Screen
name="paper"
options={{
title: 'Paper UI',
title: '我的',
tabBarIcon: ({ color }) => <TabBarIcon name="paint-brush" color={color} />,
}}
/>

View File

@@ -24,13 +24,11 @@ import { useRouter } from 'expo-router';
// 工具函数
import {
Storage,
storageManager,
STORAGE_KEYS,
SessionStorage,
SESSION_KEYS,
formatDate,
formatRelativeTime,
formatChatTime
formatChatTime,
} from '@/utils';
// 状态管理
@@ -42,18 +40,13 @@ import {
useTheme,
useLanguage,
useHapticsEnabled,
useSettingsActions,
useTenantStates,
useTenantInfo,
} from '@/stores';
import { useTenantLoad, useTenantInfo } from '@/stores/tenantStore';
// 验证规则
import { loginSchema } from '@/schemas';
import type { LoginFormData } from '@/schemas';
// API 服务
import { authService } from '@/services';
// 自定义 Hooks
import { useDebounce, useThrottle, useHaptics } from '@/hooks';
@@ -71,14 +64,14 @@ export default function DemoScreen() {
const login = useUserStore((state) => state.login);
const logout = useUserStore((state) => state.logout);
const { tenantLoad } = useTenantStates();
const tenantLoad = useTenantLoad();
const tenantInfo = useTenantInfo();
// 设置状态
const theme = useTheme();
const language = useLanguage();
const hapticsEnabled = useHapticsEnabled();
const { setTheme, setLanguage, setHapticsEnabled } = useSettingsActions();
const { setTheme, setLanguage, setHapticsEnabled } = useSettingsStore();
// const setTheme = useSettingsStore((state) => state.setTheme);
// const setLanguage = useSettingsStore((state) => state.setLanguage);
// const setHapticsEnabled = useSettingsStore((state) => state.setHapticsEnabled);
@@ -189,7 +182,7 @@ export default function DemoScreen() {
counter,
};
await Storage.setObject(STORAGE_KEYS.USER_PREFERENCES, testData);
storageManager.session.setItem(STORAGE_KEYS.USER_PREFERENCES, testData);
haptics.success();
Alert.alert('成功', '数据已保存到本地存储');
} catch (error) {
@@ -201,7 +194,7 @@ export default function DemoScreen() {
const handleLoadFromStorage = async () => {
try {
haptics.light();
const data = await Storage.getObject<any>(STORAGE_KEYS.USER_PREFERENCES);
const data = storageManager.session.getItem(STORAGE_KEYS.USER_PREFERENCES);
if (data) {
setStorageValue(JSON.stringify(data, null, 2));
@@ -229,7 +222,7 @@ export default function DemoScreen() {
counter: Math.floor(Math.random() * 100),
};
SessionStorage.setObject(SESSION_KEYS.FORM_DRAFT, testData);
storageManager.session.setItem(STORAGE_KEYS.FORM_DRAFT, testData);
haptics.success();
Alert.alert('成功', '数据已保存到会话存储(应用重启后会丢失)');
} catch (error) {
@@ -241,7 +234,7 @@ export default function DemoScreen() {
const handleLoadFromSession = () => {
try {
haptics.light();
const data = SessionStorage.getObject<any>(SESSION_KEYS.FORM_DRAFT);
const data = storageManager.session.getItem(STORAGE_KEYS.FORM_DRAFT);
if (data) {
setSessionValue(JSON.stringify(data, null, 2));
@@ -259,7 +252,7 @@ export default function DemoScreen() {
const handleClearSession = () => {
try {
haptics.light();
SessionStorage.clear();
storageManager.session.clear();
setSessionValue('');
haptics.success();
Alert.alert('成功', '会话存储已清空');
@@ -273,7 +266,7 @@ export default function DemoScreen() {
const handleThemeChange = () => {
haptics.selection();
const themes: Array<'light' | 'dark' | 'auto'> = ['light', 'dark', 'auto'];
const currentIndex = themes.indexOf(theme);
const currentIndex = themes.indexOf(theme as 'light' | 'dark' | 'auto');
const nextTheme = themes[(currentIndex + 1) % themes.length];
setTheme(nextTheme);
};
@@ -303,9 +296,7 @@ export default function DemoScreen() {
>
<Text style={styles.buttonText}> </Text>
</TouchableOpacity>
<Text style={styles.infoText}>
tabs
</Text>
<Text style={styles.infoText}> tabs</Text>
<TouchableOpacity
style={[styles.button, { backgroundColor: '#9333ea', marginTop: 12 }]}
@@ -316,9 +307,7 @@ export default function DemoScreen() {
>
<Text style={styles.buttonText}>🎨 </Text>
</TouchableOpacity>
<Text style={styles.infoText}>
</Text>
<Text style={styles.infoText}></Text>
<TouchableOpacity
style={[styles.button, { backgroundColor: '#06b6d4', marginTop: 12 }]}
@@ -329,26 +318,18 @@ export default function DemoScreen() {
>
<Text style={styles.buttonText}>📚 </Text>
</TouchableOpacity>
<Text style={styles.infoText}>
使 CSS
</Text>
<Text style={styles.infoText}>使 CSS </Text>
</View>
{/* 租户信息显示 */}
<View style={styles.section}>
<Text style={styles.sectionTitle}>🏢 </Text>
<Text style={styles.infoText}>
: {tenantLoad ? '✅ 已加载' : '❌ 未加载'}
</Text>
<Text style={styles.infoText}>: {tenantLoad ? '✅ 已加载' : '❌ 未加载'}</Text>
{tenantInfo ? (
<>
<Text style={styles.infoText}>TID: {tenantInfo.tid || '无'}</Text>
<Text style={styles.infoText}>
: {tenantInfo.create_time || '无'}
</Text>
<Text style={styles.infoText}>
: {tenantInfo.domain_addr || '无'}
</Text>
<Text style={styles.infoText}>: {tenantInfo.create_time || '无'}</Text>
<Text style={styles.infoText}>: {tenantInfo.domain_addr || '无'}</Text>
</>
) : null}
</View>

View File

@@ -1,187 +1,23 @@
import { useState, useEffect } from 'react';
import { StyleSheet, TouchableOpacity, Alert, ActivityIndicator } from 'react-native';
import * as Updates from 'expo-updates';
/**
* 首页 - 游戏大厅
*
* 重构自 xinyong-web 项目的首页
* 支持浅色/深色主题,包含轮播图、分类菜单、游戏大厅等功能
*/
import { Text, View } from '@/components/Themed';
export default function TabOneScreen() {
const [isChecking, setIsChecking] = useState(false);
const [updateInfo, setUpdateInfo] = useState<string>('');
const checkForUpdates = async () => {
if (__DEV__) {
Alert.alert('提示', '开发模式下无法检查更新,请使用生产构建测试热更新功能');
return;
}
setIsChecking(true);
setUpdateInfo('正在检查更新...');
try {
const update = await Updates.checkForUpdateAsync();
if (update.isAvailable) {
setUpdateInfo('发现新版本,正在下载...');
await Updates.fetchUpdateAsync();
Alert.alert('更新完成', '新版本已下载完成,是否立即重启应用?', [
{
text: '稍后',
style: 'cancel',
onPress: () => setUpdateInfo('更新已下载,稍后重启应用即可应用'),
},
{
text: '立即重启',
onPress: async () => {
await Updates.reloadAsync();
},
},
]);
} else {
setUpdateInfo('当前已是最新版本');
}
} catch (error) {
setUpdateInfo('检查更新失败: ' + (error as Error).message);
Alert.alert('错误', '检查更新失败,请稍后重试');
} finally {
setIsChecking(false);
}
};
const getUpdateInfo = () => {
const { isEmbeddedLaunch, isEmergencyLaunch, updateId, channel, runtimeVersion } =
Updates.useUpdates();
return `
运行模式: ${__DEV__ ? '开发模式' : '生产模式'}
是否为内嵌启动: ${isEmbeddedLaunch ? '是' : '否'}
是否为紧急启动: ${isEmergencyLaunch ? '是' : '否'}
更新 ID: ${updateId || '无'}
更新通道: ${channel || '无'}
运行时版本: ${runtimeVersion || '无'}
`.trim();
};
useEffect(() => {
console.log('=== TabOneScreen 组件已渲染 ===');
}, []);
import { Stack } from 'expo-router';
import HomeScreen from '@/pages/HomeScreen';
export default function TabHoneScreen() {
return (
<View style={styles.container}>
<Text style={styles.title}>🚀 </Text>
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
<View style={styles.infoContainer}>
<Text style={styles.infoTitle}></Text>
<Text style={styles.infoText}>{getUpdateInfo()}</Text>
</View>
<TouchableOpacity
style={[styles.button, isChecking && styles.buttonDisabled]}
onPress={checkForUpdates}
disabled={isChecking}
>
{isChecking ? (
<ActivityIndicator color="#fff" />
) : (
<Text style={styles.buttonText}></Text>
)}
</TouchableOpacity>
{updateInfo ? (
<View style={styles.updateInfoContainer}>
<Text style={styles.updateInfoText}>{updateInfo}</Text>
</View>
) : null}
<View style={styles.instructionsContainer}>
<Text style={styles.instructionsTitle}>📝 使</Text>
<Text style={styles.instructionsText}>
1. 使 EAS Build {'\n'}
2. eas update {'\n'}
3. "检查更新"{'\n'}
4.
</Text>
</View>
</View>
<>
<Stack.Screen
options={{
title: '首页',
headerShown: false,
}}
/>
<HomeScreen />
</>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
padding: 20,
},
title: {
fontSize: 28,
fontWeight: 'bold',
marginBottom: 10,
},
separator: {
marginVertical: 20,
height: 1,
width: '80%',
},
infoContainer: {
backgroundColor: 'rgba(0, 122, 255, 0.1)',
padding: 15,
borderRadius: 10,
marginBottom: 20,
width: '100%',
},
infoTitle: {
fontSize: 16,
fontWeight: 'bold',
marginBottom: 10,
},
infoText: {
fontSize: 12,
fontFamily: 'monospace',
lineHeight: 18,
},
button: {
backgroundColor: '#007AFF',
paddingHorizontal: 30,
paddingVertical: 15,
borderRadius: 10,
marginBottom: 20,
minWidth: 200,
alignItems: 'center',
},
buttonDisabled: {
backgroundColor: '#999',
},
buttonText: {
color: '#fff',
fontSize: 16,
fontWeight: 'bold',
},
updateInfoContainer: {
backgroundColor: 'rgba(52, 199, 89, 0.1)',
padding: 15,
borderRadius: 10,
marginBottom: 20,
width: '100%',
},
updateInfoText: {
fontSize: 14,
textAlign: 'center',
},
instructionsContainer: {
backgroundColor: 'rgba(255, 149, 0, 0.1)',
padding: 15,
borderRadius: 10,
width: '100%',
},
instructionsTitle: {
fontSize: 16,
fontWeight: 'bold',
marginBottom: 10,
},
instructionsText: {
fontSize: 13,
lineHeight: 20,
},
});

View File

@@ -82,7 +82,11 @@ export default function PaperDemo() {
🔘
</Text>
<View style={styles.buttonRow}>
<Button mode="contained" onPress={() => setSnackbarVisible(true)} style={{ marginRight: 8 }}>
<Button
mode="contained"
onPress={() => setSnackbarVisible(true)}
style={{ marginRight: 8 }}
>
Contained
</Button>
<Button mode="outlined" onPress={() => setSnackbarVisible(true)}>
@@ -90,7 +94,11 @@ export default function PaperDemo() {
</Button>
</View>
<View style={styles.buttonRow}>
<Button mode="text" onPress={() => setSnackbarVisible(true)} style={{ marginRight: 8 }}>
<Button
mode="text"
onPress={() => setSnackbarVisible(true)}
style={{ marginRight: 8 }}
>
Text
</Button>
<Button mode="elevated" onPress={() => setSnackbarVisible(true)} icon="camera">
@@ -140,10 +148,21 @@ export default function PaperDemo() {
<Chip icon="star" onPress={() => {}} style={{ marginRight: 8, marginBottom: 8 }}>
</Chip>
<Chip icon="heart" mode="outlined" onPress={() => {}} style={{ marginRight: 8, marginBottom: 8 }}>
<Chip
icon="heart"
mode="outlined"
onPress={() => {}}
style={{ marginRight: 8, marginBottom: 8 }}
>
</Chip>
<Chip icon="close" onPress={() => {}} onClose={() => {}} closeIcon="close-circle" style={{ marginBottom: 8 }}>
<Chip
icon="close"
onPress={() => {}}
onClose={() => {}}
closeIcon="close-circle"
style={{ marginBottom: 8 }}
>
</Chip>
</View>

View File

@@ -12,7 +12,8 @@ import { PaperProvider, MD3DarkTheme, MD3LightTheme } from 'react-native-paper';
// ✅ 从 hooks 目录导入
import { useColorScheme } from '@/hooks';
// ✅ 从 stores 目录导入
import { restoreUserState, restoreSettingsState, useTenantActions } from '@/stores';
import { restoreUserState, restoreSettingsState } from '@/stores';
import { requestTenantInfo } from '@/stores/tenantStore';
export {
// Catch any errors thrown by the Layout component.
@@ -32,7 +33,6 @@ export default function RootLayout() {
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
...FontAwesome.font,
});
const { requestTenantInfo } = useTenantActions();
// Expo Router uses Error Boundaries to catch errors in the navigation tree.
useEffect(() => {

View File

@@ -1,6 +1,6 @@
/**
* 主题系统使用示例
*
*
* 展示四种不同的主题样式使用方式
*/
@@ -78,9 +78,7 @@ export default function ThemeExampleScreen() {
<ScrollView style={s.containerPadded}>
{/* 自定义样式示例 */}
<View style={custom.header}>
<Text style={custom.headerText}>
使
</Text>
<Text style={custom.headerText}>使</Text>
<Text style={[custom.headerText, { fontSize: 14, marginTop: 8 }]}>
: {theme} {isDark ? '🌙' : '☀️'}
</Text>
@@ -88,9 +86,7 @@ export default function ThemeExampleScreen() {
{/* 方式 1: 使用主题组件 */}
<View style={custom.section}>
<Text style={custom.sectionTitle}>
1: 使用主题组件
</Text>
<Text style={custom.sectionTitle}> 1: 使用主题组件</Text>
<ThemedView style={{ padding: 12, borderRadius: 6 }}>
<ThemedText type="title"></ThemedText>
<ThemedText type="subtitle"></ThemedText>
@@ -109,9 +105,7 @@ export default function ThemeExampleScreen() {
{/* 方式 2: 使用通用样式类 */}
<View style={custom.section}>
<Text style={custom.sectionTitle}>
2: 使用通用样式类 CSS
</Text>
<Text style={custom.sectionTitle}> 2: 使用通用样式类 CSS </Text>
<View style={s.card}>
<Text style={s.textTitle}></Text>
<Text style={s.textSecondary}></Text>
@@ -143,9 +137,7 @@ const s = commonStyles[theme];
{/* 方式 3: 使用自定义主题样式 */}
<View style={custom.section}>
<Text style={custom.sectionTitle}>
3: 使用自定义主题样式
</Text>
<Text style={custom.sectionTitle}> 3: 使用自定义主题样式</Text>
<View style={{ padding: 12 }}>
<Text style={{ color: colors.text }}>
header section 使
@@ -176,14 +168,14 @@ const theme = useColorScheme();
{/* 方式 4: 使用 Hooks + 内联样式 */}
<View style={custom.section}>
<Text style={custom.sectionTitle}>
4: 使用 Hooks +
</Text>
<View style={{
backgroundColor: colors.backgroundSecondary,
padding: 16,
borderRadius: 8,
}}>
<Text style={custom.sectionTitle}> 4: 使用 Hooks + </Text>
<View
style={{
backgroundColor: colors.backgroundSecondary,
padding: 16,
borderRadius: 8,
}}
>
<Text style={{ color: colors.text, fontSize: 16 }}>
使 useThemeColors()
</Text>
@@ -212,9 +204,7 @@ const colors = useThemeColors();
{/* 颜色展示 */}
<View style={custom.section}>
<Text style={custom.sectionTitle}>
</Text>
<Text style={custom.sectionTitle}></Text>
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8 }}>
{Object.entries(colors).map(([key, value]) => (
<View
@@ -228,21 +218,27 @@ const colors = useThemeColors();
borderColor: colors.border,
}}
>
<Text style={{
color: key.includes('background') || key.includes('card') || key.includes('input')
? colors.text
: '#FFFFFF',
fontSize: 10,
fontWeight: '600',
}}>
<Text
style={{
color:
key.includes('background') || key.includes('card') || key.includes('input')
? colors.text
: '#FFFFFF',
fontSize: 10,
fontWeight: '600',
}}
>
{key}
</Text>
<Text style={{
color: key.includes('background') || key.includes('card') || key.includes('input')
? colors.textSecondary
: '#FFFFFF',
fontSize: 8,
}}>
<Text
style={{
color:
key.includes('background') || key.includes('card') || key.includes('input')
? colors.textSecondary
: '#FFFFFF',
fontSize: 8,
}}
>
{value}
</Text>
</View>
@@ -256,4 +252,3 @@ const colors = useThemeColors();
</>
);
}

View File

@@ -1,13 +1,20 @@
import { StyleSheet, ScrollView, TouchableOpacity, View, Text, useColorScheme as useSystemColorScheme } from 'react-native';
import {
StyleSheet,
ScrollView,
TouchableOpacity,
View,
Text,
useColorScheme as useSystemColorScheme,
} from 'react-native';
import { Stack } from 'expo-router';
import { useState, useEffect, useMemo } from 'react';
import { useTheme, useSettingsActions } from '@/stores';
import { useTheme, useSettingsStore } from '@/stores';
import { useHaptics } from '@/hooks';
import Colors from '@/constants/Colors';
import { Colors } from '@/theme';
export default function ThemeTestScreen() {
const currentTheme = useTheme();
const { setTheme } = useSettingsActions();
const { setTheme } = useSettingsStore();
const haptics = useHaptics();
const systemColorScheme = useSystemColorScheme();
@@ -17,7 +24,9 @@ export default function ThemeTestScreen() {
// 直接计算实际应用的主题 - 不使用 useColorScheme hook
const actualTheme: 'light' | 'dark' = useMemo(() => {
return currentTheme === 'auto'
? (systemColorScheme === 'dark' ? 'dark' : 'light')
? systemColorScheme === 'dark'
? 'dark'
: 'light'
: currentTheme;
}, [currentTheme, systemColorScheme]);
@@ -30,7 +39,7 @@ export default function ThemeTestScreen() {
// 监听主题变化
useEffect(() => {
console.log('🎨 Theme changed:', { currentTheme, systemColorScheme, actualTheme, renderKey });
setRenderKey(prev => prev + 1);
setRenderKey((prev) => prev + 1);
}, [currentTheme, systemColorScheme, actualTheme]);
const handleThemeChange = (newTheme: 'light' | 'dark' | 'auto') => {
@@ -50,14 +59,10 @@ export default function ThemeTestScreen() {
headerTintColor: colors.text,
}}
/>
<ScrollView
style={[styles.container, { backgroundColor: colors.background }]}
>
<ScrollView style={[styles.container, { backgroundColor: colors.background }]}>
{/* 主题信息 */}
<View style={[styles.section, { backgroundColor: colors.backgroundSecondary }]}>
<Text style={[styles.title, { color: colors.text }]}>
</Text>
<Text style={[styles.title, { color: colors.text }]}></Text>
<Text style={[styles.infoText, { color: colors.textSecondary }]}>
: {currentTheme}
</Text>
@@ -74,24 +79,25 @@ export default function ThemeTestScreen() {
{/* 主题切换按钮 */}
<View style={[styles.section, { backgroundColor: colors.backgroundSecondary }]}>
<Text style={[styles.title, { color: colors.text }]}>
</Text>
<Text style={[styles.title, { color: colors.text }]}></Text>
<View style={styles.buttonRow}>
<TouchableOpacity
style={[
styles.themeButton,
{
backgroundColor: currentTheme === 'light' ? colors.primary : colors.backgroundTertiary,
backgroundColor:
currentTheme === 'light' ? colors.primary : colors.backgroundTertiary,
borderColor: colors.border,
}
},
]}
onPress={() => handleThemeChange('light')}
>
<Text style={[
styles.buttonText,
{ color: currentTheme === 'light' ? '#fff' : colors.text }
]}>
<Text
style={[
styles.buttonText,
{ color: currentTheme === 'light' ? '#fff' : colors.text },
]}
>
</Text>
</TouchableOpacity>
@@ -100,16 +106,19 @@ export default function ThemeTestScreen() {
style={[
styles.themeButton,
{
backgroundColor: currentTheme === 'dark' ? colors.primary : colors.backgroundTertiary,
backgroundColor:
currentTheme === 'dark' ? colors.primary : colors.backgroundTertiary,
borderColor: colors.border,
}
},
]}
onPress={() => handleThemeChange('dark')}
>
<Text style={[
styles.buttonText,
{ color: currentTheme === 'dark' ? '#fff' : colors.text }
]}>
<Text
style={[
styles.buttonText,
{ color: currentTheme === 'dark' ? '#fff' : colors.text },
]}
>
🌙
</Text>
</TouchableOpacity>
@@ -118,16 +127,19 @@ export default function ThemeTestScreen() {
style={[
styles.themeButton,
{
backgroundColor: currentTheme === 'auto' ? colors.primary : colors.backgroundTertiary,
backgroundColor:
currentTheme === 'auto' ? colors.primary : colors.backgroundTertiary,
borderColor: colors.border,
}
},
]}
onPress={() => handleThemeChange('auto')}
>
<Text style={[
styles.buttonText,
{ color: currentTheme === 'auto' ? '#fff' : colors.text }
]}>
<Text
style={[
styles.buttonText,
{ color: currentTheme === 'auto' ? '#fff' : colors.text },
]}
>
🔄
</Text>
</TouchableOpacity>
@@ -136,9 +148,7 @@ export default function ThemeTestScreen() {
{/* 文本颜色展示 */}
<View style={[styles.section, { backgroundColor: colors.backgroundSecondary }]}>
<Text style={[styles.title, { color: colors.text }]}>
</Text>
<Text style={[styles.title, { color: colors.text }]}></Text>
<Text style={[styles.colorText, { color: colors.text }]}>
Primary Text - {colors.text}
</Text>
@@ -152,15 +162,22 @@ export default function ThemeTestScreen() {
{/* 背景颜色展示 */}
<View style={[styles.section, { backgroundColor: colors.backgroundSecondary }]}>
<Text style={[styles.title, { color: colors.text }]}>
</Text>
<Text style={[styles.title, { color: colors.text }]}></Text>
<View style={[styles.colorBox, { backgroundColor: colors.background }]}>
<Text style={[styles.colorText, { color: colors.text }]}>
Primary Background - {colors.background}
</Text>
</View>
<View style={[styles.colorBox, { backgroundColor: colors.backgroundSecondary, borderWidth: 1, borderColor: colors.border }]}>
<View
style={[
styles.colorBox,
{
backgroundColor: colors.backgroundSecondary,
borderWidth: 1,
borderColor: colors.border,
},
]}
>
<Text style={[styles.colorText, { color: colors.text }]}>
Secondary Background - {colors.backgroundSecondary}
</Text>
@@ -174,15 +191,15 @@ export default function ThemeTestScreen() {
{/* 主题颜色展示 */}
<View style={[styles.section, { backgroundColor: colors.backgroundSecondary }]}>
<Text style={[styles.title, { color: colors.text }]}>
</Text>
<Text style={[styles.title, { color: colors.text }]}></Text>
<View style={styles.colorGrid}>
<View style={[styles.colorBox, { backgroundColor: colors.primary }]}>
<Text style={[styles.colorText, { color: '#fff' }]}>Primary - {colors.primary}</Text>
</View>
<View style={[styles.colorBox, { backgroundColor: colors.secondary }]}>
<Text style={[styles.colorText, { color: '#fff' }]}>Secondary - {colors.secondary}</Text>
<Text style={[styles.colorText, { color: '#fff' }]}>
Secondary - {colors.secondary}
</Text>
</View>
<View style={[styles.colorBox, { backgroundColor: colors.success }]}>
<Text style={[styles.colorText, { color: '#fff' }]}>Success - {colors.success}</Text>
@@ -201,30 +218,27 @@ export default function ThemeTestScreen() {
{/* UI 元素展示 */}
<View style={[styles.section, { backgroundColor: colors.backgroundSecondary }]}>
<Text style={[styles.title, { color: colors.text }]}>
UI
</Text>
<Text style={[styles.title, { color: colors.text }]}>UI </Text>
<View style={[styles.card, { backgroundColor: colors.card, borderColor: colors.border }]}>
<Text style={[styles.cardText, { color: colors.text }]}>
</Text>
<Text style={[styles.cardText, { color: colors.text }]}></Text>
<Text style={[styles.cardSubtext, { color: colors.textSecondary }]}>
: {colors.card}
</Text>
</View>
<View style={[styles.input, { backgroundColor: colors.inputBackground, borderColor: colors.inputBorder }]}>
<Text style={[styles.inputText, { color: colors.textSecondary }]}>
</Text>
<View
style={[
styles.input,
{ backgroundColor: colors.inputBackground, borderColor: colors.inputBorder },
]}
>
<Text style={[styles.inputText, { color: colors.textSecondary }]}></Text>
</View>
<View style={[styles.separator, { backgroundColor: colors.separator }]} />
<TouchableOpacity style={[styles.button, { backgroundColor: colors.buttonPrimary }]}>
<Text style={[styles.buttonText, { color: '#fff' }]}>
</Text>
<Text style={[styles.buttonText, { color: '#fff' }]}></Text>
</TouchableOpacity>
</View>
</ScrollView>
@@ -314,4 +328,3 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Some files were not shown because too many files have changed in this diff Show More