- Added PlayerGameResult and PlayerGameStats types to track player results. - Introduced setupDraft type for game setup configuration. - Implemented playerGameStats in GameStoreState to maintain individual player results. - Added autoResetIfInactive method to reset game state after inactivity. - Created useAppStateListener hook for managing app state changes and auto-saving game state. - Developed streakService to calculate and format player win/loss streaks. - Updated game setup logic to preserve player stats and configurations. - Enhanced tests to cover new player theme and game state features.
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { NavigationContainer } from '@react-navigation/native';
|
|
import { StatusBar } from 'expo-status-bar';
|
|
import { StyleSheet } from 'react-native';
|
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
import { AppErrorBoundary } from './src/components/AppErrorBoundary';
|
|
import { AppNavigator } from './src/navigation/AppNavigator';
|
|
import { useInAppUpdates } from './src/hooks/useInAppUpdates';
|
|
import { useAppStateListener } from './src/hooks/useAppStateListener';
|
|
import { ui } from './src/styles/ui';
|
|
|
|
export default function App() {
|
|
useInAppUpdates();
|
|
useAppStateListener();
|
|
|
|
return (
|
|
<GestureHandlerRootView style={styles.root}>
|
|
<SafeAreaProvider>
|
|
<AppErrorBoundary>
|
|
<NavigationContainer>
|
|
<StatusBar
|
|
style="light"
|
|
translucent={false}
|
|
backgroundColor={ui.color.bg}
|
|
/>
|
|
<AppNavigator />
|
|
</NavigationContainer>
|
|
</AppErrorBoundary>
|
|
</SafeAreaProvider>
|
|
</GestureHandlerRootView>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
root: {
|
|
flex: 1,
|
|
backgroundColor: ui.color.bg,
|
|
},
|
|
});
|