diff --git a/navigation/index.js b/navigation/index.js index 503365f..ad58ddc 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -49,7 +49,7 @@ import Colors from "../src/constants/Colors"; import fontSize from "../src/constants/fontSize"; const Tab = createBottomTabNavigator(); -const BottomTabNavigator = ({ theme }) => { +const BottomTabNavigator = ({ theme, userProducts }) => { const insets = useSafeAreaInsets(); const [headerShown, setHeaderShown] = React.useState(true); React.useEffect(() => { @@ -64,6 +64,10 @@ const BottomTabNavigator = ({ theme }) => { screenOptions={{ tabBarHideOnKeyboard: true, headerShown, + headerStyle: { + backgroundColor: + theme === "light" ? Colors.theme1.white : Colors.theme1.dark, + }, tabBarIconStyle: { transform: [{ scaleX: -1 }], }, @@ -77,7 +81,7 @@ const BottomTabNavigator = ({ theme }) => { theme === "light" ? Colors.theme1.white : Colors.theme1.dark, transform: [{ scaleX: -1 }], height: 65 + insets.bottom, - borderWidth : 0 + borderWidth: 0, }, tabBarLabelStyle: { transform: [{ scaleX: -1 }, { translateY: -5 }], @@ -123,7 +127,7 @@ const BottomTabNavigator = ({ theme }) => { width={33.58} height={33.579} style={{ - transform: [{scale : 0.7}] + transform: [{ scale: 0.7 }], }} > { width={35.135} height={34.763} style={{ - transform: [{scale : 0.7}] + transform: [{ scale: 0.7 }], }} > { name="ShoppingCartTab" children={() => } options={{ - // tabBarBadge: count, - // tabBarBadgeStyle: { - // color: "white", - // backgroundColor: Colors.theme1.['light'].green79, - // fontSize: fontSize.sm, - // }, + tabBarBadge: userProducts.filter((product) => product.condition < 2) + .length + ? userProducts.filter((product) => product.condition < 2).length + : null, + tabBarBadgeStyle: { + color: "white", + backgroundColor: + theme === "light" ? Colors.theme1.greenCF : Colors.theme1.greenCF, + fontSize: fontSize.sm, + paddingTop: fontSize.sm / 4, + color: theme === "light" ? Colors.theme1.white : Colors.theme1.dark, + borderWidth: 1, + borderColor: + theme === "light" ? Colors.theme1.greenCF : Colors.theme1.dark, + fontFamily: "bold", + }, title: "سبد خرید", tabBarIcon: ({ focused, color }) => focused ? ( @@ -313,7 +327,7 @@ const BottomTabNavigator = ({ theme }) => { xmlns="http://www.w3.org/2000/svg" width={31.017} height={31.017} - style={{ transform: [{scale : 1.2}]}} + style={{ transform: [{ scale: 1.2 }] }} > { ? Colors.theme1.green79 : Colors.theme1.greenCF } - stroke={theme === 'light' ? "white" : Colors.theme1.dark} + stroke={theme === "light" ? "white" : Colors.theme1.dark} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -489,7 +503,6 @@ const VODStackScreen = ({ theme }) => { }, }} initialRouteName="VOD" - > @@ -587,7 +600,9 @@ const Navigation = ({ } + children={() => ( + + )} /> diff --git a/src/components/Navbar.js b/src/components/Navbar.js index ae8f670..bd503f7 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -74,7 +74,7 @@ const Navbar = ({ return ( navigation.push("Tickets") }, call: { icon: callIcon, @@ -59,7 +60,8 @@ function Contact({ theme }) { link: null, bg: "#69FF5F33", borderColor: "#69FF5F55", - onPress : () => {} + onPress : () => Linking.openURL(`tel:02188814637`) + }, address: { icon: addressIcon, diff --git a/src/screens/Contact/layouts/Box.js b/src/screens/Contact/layouts/Box.js index f6bb372..c8ef59b 100644 --- a/src/screens/Contact/layouts/Box.js +++ b/src/screens/Contact/layouts/Box.js @@ -17,6 +17,7 @@ const ios = Platform.OS === "ios"; const { height, width } = Dimensions.get("window"); const Box = ({ info, mobile }) => { + console.log(info); return ( { borderWidth: 1, }, ]} - onPress={() => info.onPress()} + onPress={() => info?.onPress()} + > { }; return ( - + { // Later on in your styles.. const styles = StyleSheet.create({ + safeStyle: { + paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, + flex: 1, + }, contentContainerStyle: { // paddingBottom: 40, // flex : 1, diff --git a/src/screens/Profile/index.js b/src/screens/Profile/index.js index 5455a83..a97902b 100644 --- a/src/screens/Profile/index.js +++ b/src/screens/Profile/index.js @@ -72,6 +72,7 @@ function Profile({ mobile, theme, logout, loading }) { onPress={() => asyncAwesomeAlert("", "آیا قصد خروج از حساب کاربری فعلی رو داری؟", { showCancelButton: true, + confirmText : 'آره', onConfirm: () => { navigation.navigate("HomeTab", { screen: "Home" }); logout();