feat: 首页更新

This commit is contained in:
2025-11-12 00:13:26 +08:00
parent b48cce06f4
commit 9ef9233797
46 changed files with 660 additions and 369 deletions

View File

@@ -15,8 +15,8 @@ import {
ActivityIndicator,
Dimensions,
} from 'react-native';
import { createThemeStyles } from '@/theme';
import Colors from '@/constants/Colors';
import { createThemeStyles, useColorScheme, useThemeInfo } from '@/theme';
import { useSelectedCategory } from '@/hooks/useGameMenus';
import { getMockGamesByCategory } from '@/services/mockHomeService';
import type { Game } from '@/types/home';
@@ -100,9 +100,7 @@ const styles = createThemeStyles((colors) => ({
}));
interface LobbyProps {
theme: 'light' | 'dark';
games?: Game[];
selectedCategory?: number;
onGamePress?: (game: Game) => void;
topHeight?: number;
}
@@ -111,13 +109,14 @@ interface LobbyProps {
* 游戏大厅组件
*/
export default function Lobby({
theme,
games: propGames,
selectedCategory = 0,
onGamePress,
topHeight = 0,
}: LobbyProps) {
const s = styles[theme];
const colorScheme = useColorScheme();
const s = styles[colorScheme];
const { colors } = useThemeInfo();
const { selectedCategory } = useSelectedCategory();
const [games, setGames] = useState<Game[]>(propGames || []);
const [loading, setLoading] = useState(true);
@@ -179,7 +178,7 @@ export default function Lobby({
if (loading) {
return (
<View style={s.loadingContainer}>
<ActivityIndicator size="large" color={Colors[theme].primary} />
<ActivityIndicator size="large" color={colors.primary} />
</View>
);
}