|
|
@ -4,94 +4,68 @@ import {createNativeStackNavigator} from '@react-navigation/native-stack'; |
|
|
|
import Splash from './src/screens/Splash'; |
|
|
|
import Splash from './src/screens/Splash'; |
|
|
|
import Home from './src/screens/Home'; |
|
|
|
import Home from './src/screens/Home'; |
|
|
|
import Login from './src/screens/Login'; |
|
|
|
import Login from './src/screens/Login'; |
|
|
|
import Otp from './src/screens/Otp'; |
|
|
|
import Otp from "./src/screens/Otp"; |
|
|
|
<<<<<<< HEAD |
|
|
|
|
|
|
|
import Product from './src/screens/Product'; |
|
|
|
import Product from './src/screens/Product'; |
|
|
|
import Products from './src/screens/Products'; |
|
|
|
import Products from './src/screens/Products'; |
|
|
|
import ShoppingCart from './src/screens/ShoppingCart'; |
|
|
|
import ShoppingCart from './src/screens/ShoppingCart'; |
|
|
|
import QR from './src/screens/QR/index'; |
|
|
|
import QR from './src/screens/QR/index'; |
|
|
|
import {connect} from 'react-redux'; |
|
|
|
import {connect} from 'react-redux'; |
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = state => { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
profile: state.profile, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
======= |
|
|
|
|
|
|
|
import {connect} from 'react-redux'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = state => { |
|
|
|
const mapStateToProps = state => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
profile: state.profile |
|
|
|
profile: state.profile, |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
}; |
|
|
|
>>>>>>> 93c1e23879a6378e3a83f8947b0d8051717854b3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Stack = createNativeStackNavigator(); |
|
|
|
const Stack = createNativeStackNavigator(); |
|
|
|
|
|
|
|
|
|
|
|
function Navigator(props) { |
|
|
|
function Navigator(props) { |
|
|
|
<<<<<<< HEAD |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<NavigationContainer> |
|
|
|
|
|
|
|
<Stack.Navigator> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
|
|
|
name="Splash" |
|
|
|
|
|
|
|
component={Splash} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
{!props.profile.token ? ( |
|
|
|
|
|
|
|
<> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="Login" |
|
|
|
|
|
|
|
component={Login} |
|
|
|
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="Otp" |
|
|
|
|
|
|
|
component={Otp} |
|
|
|
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<> |
|
|
|
|
|
|
|
<Stack.Screen name="Home" component={Home} /> |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="Product" |
|
|
|
|
|
|
|
component={Product} |
|
|
|
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="Products" |
|
|
|
|
|
|
|
component={Products} |
|
|
|
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="QR" |
|
|
|
|
|
|
|
component={QR} |
|
|
|
|
|
|
|
options={{headerShown: true}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="سبد خرید" |
|
|
|
|
|
|
|
component={ShoppingCart} |
|
|
|
|
|
|
|
options={{headerShown: true}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Stack.Navigator> |
|
|
|
|
|
|
|
</NavigationContainer> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
======= |
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<NavigationContainer> |
|
|
|
<NavigationContainer> |
|
|
|
<Stack.Navigator> |
|
|
|
<Stack.Navigator> |
|
|
|
<Stack.Screen options={{headerShown: false}} name="Splash" component={Splash}/> |
|
|
|
<Stack.Screen |
|
|
|
<Stack.Screen name="Login" component={Login} options={{headerShown: false}}/> |
|
|
|
options={{headerShown: false}} |
|
|
|
<Stack.Screen name="Otp" component={Otp} options={{headerShown: false}}/> |
|
|
|
name="Splash" |
|
|
|
<Stack.Screen name="Home" component={Home}/> |
|
|
|
component={Splash} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="Login" |
|
|
|
|
|
|
|
component={Login} |
|
|
|
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="Otp" |
|
|
|
|
|
|
|
component={Otp} |
|
|
|
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
<> |
|
|
|
|
|
|
|
<Stack.Screen name="Home" component={Home}/> |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="Product" |
|
|
|
|
|
|
|
component={Product} |
|
|
|
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="Products" |
|
|
|
|
|
|
|
component={Products} |
|
|
|
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="QR" |
|
|
|
|
|
|
|
component={QR} |
|
|
|
|
|
|
|
options={{headerShown: true}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Stack.Screen |
|
|
|
|
|
|
|
name="سبد خرید" |
|
|
|
|
|
|
|
component={ShoppingCart} |
|
|
|
|
|
|
|
options={{headerShown: true}} |
|
|
|
|
|
|
|
/> |
|
|
|
</Stack.Navigator> |
|
|
|
</Stack.Navigator> |
|
|
|
</NavigationContainer> |
|
|
|
</NavigationContainer> |
|
|
|
); |
|
|
|
); |
|
|
|
>>>>>>> 93c1e23879a6378e3a83f8947b0d8051717854b3 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(Navigator); |
|
|
|
export default connect(mapStateToProps)(Navigator); |
|
|
|