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.
208 lines
6.3 KiB
208 lines
6.3 KiB
import React from "react"; |
|
import { NavigationContainer } from "@react-navigation/native"; |
|
import { createNativeStackNavigator } from "@react-navigation/native-stack"; |
|
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; |
|
import { |
|
Entypo, |
|
FontAwesome, |
|
Ionicons, |
|
MaterialIcons, |
|
} from "@expo/vector-icons"; |
|
import OrderDetails from "../src/screens/OrderDetails"; |
|
import OrdersFollowUp from "../src/screens/OrdersFollowUp"; |
|
import { Dimensions } from "react-native"; |
|
import Splash from "../src/screens/Splash"; |
|
import Home from "../src/screens/Home"; |
|
import Products from "../src/screens/Products"; |
|
import Login from "../src/screens/Login"; |
|
import Otp from "../src/screens/Otp"; |
|
import Product from "../src/screens/Product"; |
|
import QR from "../src/screens/QR"; |
|
import Faq from "../src/screens/Faq"; |
|
import Activation from "../src/screens/Activation"; |
|
import { connect } from "react-redux"; |
|
import Profile from "../src/screens/Profile"; |
|
import Videos from "../src/screens/Videos"; |
|
import Exams from "../src/screens/Exams"; |
|
import ShoppingCart from "../src/screens/ShoppingCart"; |
|
import Video from "../src/screens/Video"; |
|
import VideoDisplay from "../src/screens/VideoDisplay"; |
|
|
|
const width = Dimensions.get("window").width; |
|
|
|
const Tab = createBottomTabNavigator(); |
|
const BottomTabNavigator = () => { |
|
return ( |
|
<Tab.Navigator |
|
initialRouteName="HomeTab" |
|
screenOptions={{ |
|
headerShown: false, |
|
tabBarActiveTintColor: "#06BACE", |
|
tabBarInactiveTintColor: "grey", |
|
tabBarStyle: { |
|
backgroundColor: "#CCE6FF", |
|
}, |
|
tabBarLabelStyle: { |
|
fontSize: width / 39, |
|
fontFamily: "light", |
|
}, |
|
tabBarShowLabel: false, |
|
// tabBarLabel : 'reza' |
|
}} |
|
> |
|
{/* <Tab.Screen |
|
name="SplashTab" |
|
component={AuthStackScreen} |
|
options={{ |
|
tabBarIcon: ({ focused, color }) => ( |
|
<FontAwesome name="user" size={focused ? 27 : 23} color={color} /> |
|
), |
|
}} |
|
/> */} |
|
<Tab.Screen |
|
name="ShoppingCartTab" |
|
component={ShoppingCart} |
|
options={{ |
|
tabBarIcon: ({ focused, color }) => ( |
|
<FontAwesome |
|
name="shopping-cart" |
|
size={focused ? 27 : 23} |
|
color={color} |
|
/> |
|
), |
|
}} |
|
/> |
|
<Tab.Screen |
|
name="VODTab" |
|
component={VODStackScreen} |
|
options={{ |
|
tabBarIcon: ({ focused, color }) => ( |
|
<MaterialIcons |
|
name="ondemand-video" |
|
size={focused ? 27 : 23} |
|
color={color} |
|
/> |
|
), |
|
}} |
|
/> |
|
<Tab.Screen |
|
name="ProductsTab" |
|
component={ProductsStackScreen} |
|
options={{ |
|
tabBarIcon: ({ focused, color }) => ( |
|
<Entypo name="shop" size={focused ? 27 : 23} color={color} /> |
|
), |
|
}} |
|
/> |
|
<Tab.Screen |
|
name="HomeTab" |
|
component={HomeStackScreen} |
|
options={{ |
|
tabBarIcon: ({ focused, color }) => ( |
|
<Ionicons |
|
name="home-outline" |
|
size={focused ? 27 : 23} |
|
color={color} |
|
/> |
|
), |
|
}} |
|
/> |
|
</Tab.Navigator> |
|
); |
|
}; |
|
|
|
const HomeStack = createNativeStackNavigator(); |
|
const HomeStackScreen = () => { |
|
return ( |
|
<HomeStack.Navigator |
|
screenOptions={{ headerShown: false }} |
|
initialRouteName="Home" |
|
> |
|
<HomeStack.Screen name="Home" component={Home} /> |
|
<HomeStack.Screen name="QR" component={QR} /> |
|
<HomeStack.Screen name="Product" component={Product} /> |
|
<Stack.Screen name="Orders" component={OrderStackScreen} /> |
|
<Stack.Screen name="Faq" component={Faq} /> |
|
<Stack.Screen name="Activation" component={Activation} /> |
|
</HomeStack.Navigator> |
|
); |
|
}; |
|
|
|
const ProductsStack = createNativeStackNavigator(); |
|
const ProductsStackScreen = () => { |
|
return ( |
|
<ProductsStack.Navigator screenOptions={{ headerShown: false }}> |
|
<ProductsStack.Screen name="Products" component={Products} /> |
|
<ProductsStack.Screen name="QR" component={QR} /> |
|
<ProductsStack.Screen name="Product" component={Product} /> |
|
<ProductsStack.Screen name="Orders" component={OrderStackScreen} /> |
|
<ProductsStack.Screen name="Faq" component={Faq} /> |
|
<ProductsStack.Screen name="Activation" component={Activation} /> |
|
</ProductsStack.Navigator> |
|
); |
|
}; |
|
|
|
const VODStack = createNativeStackNavigator(); |
|
const VODStackScreen = () => { |
|
return ( |
|
<VODStack.Navigator screenOptions={{ headerShown: false }}> |
|
<VODStack.Screen name="VOD" component={Videos} /> |
|
<VODStack.Screen name="Video" component={Video} /> |
|
<VODStack.Screen name="VideoDisplay" component={VideoDisplay} /> |
|
<VODStack.Screen name="QR" component={QR} /> |
|
<VODStack.Screen name="Orders" component={OrderStackScreen} /> |
|
<VODStack.Screen name="Faq" component={Faq} /> |
|
<VODStack.Screen name="Activation" component={Activation} /> |
|
</VODStack.Navigator> |
|
); |
|
}; |
|
|
|
const AuthStack = createNativeStackNavigator(); |
|
const AuthStackScreen = () => { |
|
return ( |
|
<AuthStack.Navigator |
|
screenOptions={{ headerShown: false }} |
|
// initialRouteName="Splash" |
|
> |
|
<AuthStack.Screen name="Splash" component={Splash} /> |
|
<AuthStack.Screen name="Login" component={Login} /> |
|
<AuthStack.Screen name="Otp" component={Otp} /> |
|
</AuthStack.Navigator> |
|
); |
|
}; |
|
|
|
const OrderStack = createNativeStackNavigator(); |
|
const OrderStackScreen = () => { |
|
return ( |
|
<OrderStack.Navigator |
|
screenOptions={{ headerShown: false }} |
|
initialRouteName="Orders" |
|
> |
|
<OrderStack.Screen name="Orders" component={OrdersFollowUp} /> |
|
<OrderStack.Screen name="Order" component={OrderDetails} /> |
|
</OrderStack.Navigator> |
|
); |
|
}; |
|
|
|
const Stack = createNativeStackNavigator(); |
|
const Navigation = ({}) => { |
|
return ( |
|
<NavigationContainer> |
|
<Stack.Navigator |
|
// initialRouteName="Root" |
|
screenOptions={{ headerShown: false }} |
|
> |
|
<Stack.Screen name="Splash" component={Splash} /> |
|
<Stack.Screen name="Login" component={Login} /> |
|
<Stack.Screen name="Otp" component={Otp} /> |
|
<Stack.Screen name="Root" component={BottomTabNavigator} /> |
|
</Stack.Navigator> |
|
</NavigationContainer> |
|
); |
|
}; |
|
|
|
const mapStateToProps = (state) => { |
|
return {}; |
|
}; |
|
|
|
export default connect(mapStateToProps)(Navigation);
|
|
|