|
|
|
@ -4,94 +4,68 @@ import {createNativeStackNavigator} from '@react-navigation/native-stack'; |
|
|
|
|
import Splash from './src/screens/Splash'; |
|
|
|
|
import Home from './src/screens/Home'; |
|
|
|
|
import Login from './src/screens/Login'; |
|
|
|
|
import Otp from './src/screens/Otp'; |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
import Otp from "./src/screens/Otp"; |
|
|
|
|
import Product from './src/screens/Product'; |
|
|
|
|
import Products from './src/screens/Products'; |
|
|
|
|
import ShoppingCart from './src/screens/ShoppingCart'; |
|
|
|
|
import QR from './src/screens/QR/index'; |
|
|
|
|
import {connect} from 'react-redux'; |
|
|
|
|
|
|
|
|
|
const mapStateToProps = state => { |
|
|
|
|
return { |
|
|
|
|
profile: state.profile, |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
======= |
|
|
|
|
import {connect} from 'react-redux'; |
|
|
|
|
|
|
|
|
|
const mapStateToProps = state => { |
|
|
|
|
return { |
|
|
|
|
profile: state.profile |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
>>>>>>> 93c1e23879a6378e3a83f8947b0d8051717854b3 |
|
|
|
|
profile: state.profile, |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const Stack = createNativeStackNavigator(); |
|
|
|
|
|
|
|
|
|
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 ( |
|
|
|
|
<NavigationContainer> |
|
|
|
|
<Stack.Navigator> |
|
|
|
|
<Stack.Screen options={{headerShown: false}} name="Splash" 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 |
|
|
|
|
options={{headerShown: false}} |
|
|
|
|
name="Splash" |
|
|
|
|
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> |
|
|
|
|
</NavigationContainer> |
|
|
|
|
); |
|
|
|
|
>>>>>>> 93c1e23879a6378e3a83f8947b0d8051717854b3 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(Navigator); |
|
|
|
|