You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.3 KiB
59 lines
1.3 KiB
/** |
|
* 首页主容器组件 |
|
* |
|
* 支持浅色/深色主题,包含完整的首页功能: |
|
* - Header(搜索、用户信息) |
|
* - 轮播图 |
|
* - 游戏分类菜单 |
|
* - 游戏大厅 |
|
* - 公告栏 |
|
* - 高奖金游戏(深色主题) |
|
* - 快速导航(深色主题) |
|
* - BottomTabs(底部导航) |
|
*/ |
|
|
|
import React, { useMemo, useCallback } from 'react'; |
|
import { ScrollView, StyleSheet, RefreshControl } from 'react-native'; |
|
import { useColorScheme } from '@/hooks'; |
|
import { createThemeStyles } from '@/theme'; |
|
import Colors from '@/constants/Colors'; |
|
import HomeScreenComplete from './HomeScreenComplete'; |
|
|
|
/** |
|
* 创建主题样式 |
|
*/ |
|
const styles = createThemeStyles((colors) => ({ |
|
container: { |
|
flex: 1, |
|
backgroundColor: colors.background, |
|
}, |
|
scrollView: { |
|
flex: 1, |
|
}, |
|
})); |
|
|
|
/** |
|
* 首页主容器组件 |
|
*/ |
|
export default function HomeScreen() { |
|
const theme = useColorScheme(); |
|
const s = styles[theme]; |
|
const [refreshing, setRefreshing] = React.useState(false); |
|
|
|
// 下拉刷新处理 |
|
const onRefresh = useCallback(() => { |
|
setRefreshing(true); |
|
// 模拟刷新延迟 |
|
setTimeout(() => { |
|
setRefreshing(false); |
|
}, 1000); |
|
}, []); |
|
|
|
return ( |
|
<HomeScreenComplete |
|
theme={theme} |
|
isDarkTheme={theme === 'dark'} |
|
/> |
|
); |
|
} |
|
|
|
|