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.

101 lines
3.1 KiB

2 months ago
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { CountrySelect } from './app/screens/CountrySelect';
import { MainApp } from './app/screens/MainApp';
import { LoginScreen } from './app/screens/LoginScreen';
import { EmailLoginScreen } from './app/screens/EmailLoginScreen';
2 months ago
import './app/i18n';
import { TabNavigator } from './app/navigation/TabNavigator';
import { AuthProvider } from './app/contexts/AuthContext';
import { SearchScreen } from './app/screens/SearchScreen';
import { SearchResultScreen } from './app/screens/SearchResultScreen';
import { ProductDetailScreen } from './app/screens/ProductDetailScreen';
2 months ago
export type RootStackParamList = {
CountrySelect: undefined;
MainApp: undefined;
Login: undefined;
EmailLogin: undefined;
MainTabs: undefined;
Search: undefined;
SearchResult: { keyword: string };
ProductDetail: { productId: string; searchKeyword?: string };
2 months ago
};
const Stack = createNativeStackNavigator<RootStackParamList>();
export default function App() {
return (
<AuthProvider>
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerShown: false,
2 months ago
}}
>
<Stack.Screen name="CountrySelect" component={CountrySelect} />
<Stack.Screen
name="Login"
component={LoginScreen}
options={{
presentation: 'modal',
animation: 'slide_from_bottom',
gestureEnabled: true,
gestureDirection: 'vertical'
}}
/>
<Stack.Screen
name="MainTabs"
component={TabNavigator}
options={{
gestureEnabled: false
}}
/>
<Stack.Screen
name="EmailLogin"
component={EmailLoginScreen}
options={{
presentation: 'modal',
animation: 'slide_from_bottom',
gestureEnabled: true,
gestureDirection: 'vertical',
}}
/>
<Stack.Screen
name="Search"
component={SearchScreen}
options={{
presentation: 'fullScreenModal',
animation: 'fade',
animationDuration: 200,
gestureEnabled: true,
gestureDirection: 'vertical',
contentStyle: { backgroundColor: '#ffffff' }
}}
/>
<Stack.Screen
name="SearchResult"
component={SearchResultScreen}
options={{
animation: 'slide_from_right',
gestureEnabled: true,
gestureDirection: 'horizontal',
}}
/>
<Stack.Screen
name="ProductDetail"
component={ProductDetailScreen}
options={{
animation: 'slide_from_right',
gestureEnabled: true,
gestureDirection: 'horizontal',
}}
/>
</Stack.Navigator>
</NavigationContainer>
</AuthProvider>
);
}