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