|
|
|
@ -52,7 +52,12 @@ import Colors from "../src/constants/Colors"; |
|
|
|
|
import fontSize from "../src/constants/fontSize"; |
|
|
|
|
|
|
|
|
|
const Tab = createBottomTabNavigator(); |
|
|
|
|
const BottomTabNavigator = ({ theme, userProducts, bottomNavigation }) => { |
|
|
|
|
const BottomTabNavigator = ({ |
|
|
|
|
theme, |
|
|
|
|
userProducts, |
|
|
|
|
bottomNavigation, |
|
|
|
|
startUserGuide, |
|
|
|
|
}) => { |
|
|
|
|
const insets = useSafeAreaInsets(); |
|
|
|
|
const [headerShown, setHeaderShown] = React.useState(true); |
|
|
|
|
React.useEffect(() => { |
|
|
|
@ -97,7 +102,9 @@ const BottomTabNavigator = ({ theme, userProducts, bottomNavigation }) => { |
|
|
|
|
{bottomNavigation.home.isActive ? ( |
|
|
|
|
<Tab.Screen |
|
|
|
|
name="HomeTab" |
|
|
|
|
children={() => <HomeStackScreen theme={theme} />} |
|
|
|
|
children={() => ( |
|
|
|
|
<HomeStackScreen startUserGuide={startUserGuide} theme={theme} /> |
|
|
|
|
)} |
|
|
|
|
options={{ |
|
|
|
|
title: bottomNavigation.home.label, |
|
|
|
|
tabBarIcon: ({ focused, color }) => |
|
|
|
@ -320,9 +327,11 @@ const BottomTabNavigator = ({ theme, userProducts, bottomNavigation }) => { |
|
|
|
|
name="ShoppingCartTab" |
|
|
|
|
children={() => <CARTStackScreen theme={theme} />} |
|
|
|
|
options={{ |
|
|
|
|
tabBarBadge: userProducts?.filter((product) => product?.condition < 2) |
|
|
|
|
.length |
|
|
|
|
? userProducts?.filter((product) => product?.condition < 2)?.length |
|
|
|
|
tabBarBadge: userProducts?.filter( |
|
|
|
|
(product) => product?.condition < 2 |
|
|
|
|
).length |
|
|
|
|
? userProducts?.filter((product) => product?.condition < 2) |
|
|
|
|
?.length |
|
|
|
|
: null, |
|
|
|
|
tabBarBadgeStyle: { |
|
|
|
|
color: "white", |
|
|
|
@ -466,7 +475,7 @@ const BottomTabNavigator = ({ theme, userProducts, bottomNavigation }) => { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const HomeStack = createNativeStackNavigator(); |
|
|
|
|
const HomeStackScreen = ({ theme }) => { |
|
|
|
|
const HomeStackScreen = ({ theme, startUserGuide }) => { |
|
|
|
|
return ( |
|
|
|
|
<HomeStack.Navigator |
|
|
|
|
screenOptions={{ |
|
|
|
@ -475,11 +484,14 @@ const HomeStackScreen = ({ theme }) => { |
|
|
|
|
backgroundColor: |
|
|
|
|
theme === "light" ? Colors.theme1.white : Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
unmountOnBlur: true |
|
|
|
|
unmountOnBlur: true, |
|
|
|
|
}} |
|
|
|
|
initialRouteName="Home" |
|
|
|
|
> |
|
|
|
|
<HomeStack.Screen name="Home" component={Home} /> |
|
|
|
|
<HomeStack.Screen |
|
|
|
|
name="Home" |
|
|
|
|
children={() => <Home startUserGuide={startUserGuide} />} |
|
|
|
|
/> |
|
|
|
|
<HomeStack.Screen name="VOD" component={Videos} /> |
|
|
|
|
<HomeStack.Screen name="Video" component={Video} unmountOnExit={true} /> |
|
|
|
|
<HomeStack.Screen name="VideoDisplay" component={VideoDisplay} /> |
|
|
|
@ -504,7 +516,7 @@ const ProductsStackScreen = ({ theme }) => { |
|
|
|
|
backgroundColor: |
|
|
|
|
theme === "light" ? Colors.theme1.white : Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
unmountOnBlur: true |
|
|
|
|
unmountOnBlur: true, |
|
|
|
|
}} |
|
|
|
|
initialRouteName="Products" |
|
|
|
|
> |
|
|
|
@ -526,7 +538,7 @@ const VODStackScreen = ({ theme }) => { |
|
|
|
|
backgroundColor: |
|
|
|
|
theme === "light" ? Colors.theme1.white : Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
unmountOnBlur: true |
|
|
|
|
unmountOnBlur: true, |
|
|
|
|
}} |
|
|
|
|
initialRouteName="VOD" |
|
|
|
|
> |
|
|
|
@ -547,7 +559,7 @@ const CARTStackScreen = ({ theme }) => { |
|
|
|
|
backgroundColor: |
|
|
|
|
theme === "light" ? Colors.theme1.white : Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
unmountOnBlur: true |
|
|
|
|
unmountOnBlur: true, |
|
|
|
|
}} |
|
|
|
|
initialRouteName="ShoppingCart" |
|
|
|
|
> |
|
|
|
@ -568,7 +580,7 @@ const PROFILEStackScreen = ({ theme }) => { |
|
|
|
|
backgroundColor: |
|
|
|
|
theme === "light" ? Colors.theme1.white : Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
unmountOnBlur: true |
|
|
|
|
unmountOnBlur: true, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<PROFILEStack.Screen name="Profile" component={Profile} /> |
|
|
|
@ -594,6 +606,7 @@ const Navigation = ({ |
|
|
|
|
theme, |
|
|
|
|
setOrientation, |
|
|
|
|
bottomNavigation, |
|
|
|
|
startUserGuide, |
|
|
|
|
}) => { |
|
|
|
|
const linking = { |
|
|
|
|
prefixes: [prefix], |
|
|
|
@ -631,7 +644,7 @@ const Navigation = ({ |
|
|
|
|
backgroundColor: |
|
|
|
|
theme === "light" ? Colors.theme1.white : Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
unmountOnBlur: true |
|
|
|
|
unmountOnBlur: true, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<Stack.Screen name="Splash" component={Splash} /> |
|
|
|
@ -645,6 +658,7 @@ const Navigation = ({ |
|
|
|
|
theme={theme} |
|
|
|
|
userProducts={userProducts} |
|
|
|
|
bottomNavigation={bottomNavigation} |
|
|
|
|
startUserGuide={startUserGuide} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|