From 5e1bece2f358d21af932524167288162127b591c Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Thu, 21 Apr 2022 13:41:21 +0430 Subject: [PATCH] reza fixed one toxmi bug --- navigation/index.js | 2 + src/components/BottomSheet.js | 13 - src/components/CustomTextInput.js | 38 +- src/components/Drawer.js | 14 +- src/components/Empty.js | 6 +- src/components/Navbar.js | 65 +-- src/components/Scanner.js | 16 +- src/redux/reducers/activation.js | 1 + src/redux/reducers/book.js | 1 + src/redux/reducers/comment.js | 2 + src/redux/reducers/product.js | 1 + src/redux/reducers/user.js | 1 + src/redux/reducers/userFavorite.js | 1 + src/redux/reducers/userProduct.js | 1 + src/redux/reducers/vote.js | 1 + src/screens/AR/index.js | 7 +- src/screens/Address/index.js | 6 +- src/screens/Blog/index.js | 26 +- src/screens/Contact/layouts/Ticket.js | 8 +- src/screens/DeliveryForm/Address/index.js | 66 +-- src/screens/Faq/components/Instance.js | 4 +- src/screens/Faq/index.js | 5 +- src/screens/Home/components/MyBooks.js | 4 +- src/screens/Home/index.js | 2 +- src/screens/Login/index.js | 2 +- src/screens/Product/components/Book.js | 16 +- src/screens/Products/components/Main.js | 30 +- .../components/ProfileAddress/index.js | 8 +- .../components/ProfileBookmark/index.js | 109 ++--- src/screens/Profile/components/User.js | 7 +- src/screens/QRContent/Tab/index.js | 35 +- src/screens/QRContent/index.js | 2 +- src/screens/ShoppingCart/components/Code.js | 10 +- .../ShoppingCart/components/Product.js | 419 +++++++++--------- src/screens/ShoppingCart/index.js | 9 +- src/screens/Video/components/Season.js | 22 +- src/screens/Video/index.js | 6 +- src/screens/VideoDisplay/index.js | 8 +- src/screens/Videos/index.js | 8 +- 39 files changed, 514 insertions(+), 468 deletions(-) delete mode 100644 src/components/BottomSheet.js diff --git a/navigation/index.js b/navigation/index.js index d0b7581..6cb5891 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -446,6 +446,8 @@ const PROFILEStackScreen = () => { + + ); diff --git a/src/components/BottomSheet.js b/src/components/BottomSheet.js deleted file mode 100644 index 31eaab4..0000000 --- a/src/components/BottomSheet.js +++ /dev/null @@ -1,13 +0,0 @@ -import { View, Text } from 'react-native'; -import React from 'react'; - -const BottomSheet = () => { - return ( - - - - ); -}; - -export default BottomSheet; - diff --git a/src/components/CustomTextInput.js b/src/components/CustomTextInput.js index 93c9490..68c57ff 100644 --- a/src/components/CustomTextInput.js +++ b/src/components/CustomTextInput.js @@ -1,12 +1,6 @@ -import React, { useState } from "react"; -import { - TextInput, - View, - Text, - Dimensions, - StyleSheet, -} from "react-native"; -import {connect} from 'react-redux'; +import React from "react"; +import { TextInput, View, Text, StyleSheet } from "react-native"; +import { connect } from "react-redux"; import tw from "tailwind-rn"; import Colors from "../constants/Colors"; @@ -20,7 +14,7 @@ const FloatingLabelInput = ({ onChange, name, value, - color, + textColor, placeholder, maxLength, autoFocus, @@ -31,7 +25,10 @@ const FloatingLabelInput = ({ theme, ...props }) => { - const [isFocused, setIsFocused] = useState(false); + const [isFocused, setIsFocused] = React.useState(false); + const color = React.useMemo(() => { + return Colors.theme1[theme]; + }, [theme]); const styles = StyleSheet.create({ labelStyle: { @@ -47,17 +44,13 @@ const FloatingLabelInput = ({ : -Math.floor(fontSize.sm), }, ], - color: !isFocused - ? Colors.theme1[theme].gray2077 - : Colors.theme1[theme].green79, + color: !isFocused ? color.gray2077 : color.green79, }, inputStyle: { fontSize: fontSize.lg, - color: Colors.theme1[theme].black, + color: color.black, borderWidth: 1, - borderColor: isFocused - ? Colors.theme1[theme].greenC8 - : Colors.theme1[theme].gray2077 + "66", + borderColor: isFocused ? color.greenC8 : color.gray2077 + "66", textAlign: textAlign, fontFamily: "regular", direction: direction ? direction : "rtl", @@ -83,7 +76,10 @@ const FloatingLabelInput = ({ {label} onChange(name, (text = regex(text)))} placeholder={placeholder} onFocus={() => setIsFocused(true)} @@ -101,7 +97,7 @@ const FloatingLabelInput = ({ const mapStateToProps = (state) => ({ mobile: state.publicApi.mobile, - theme: state.publicApi.theme -}) + theme: state.publicApi.theme, +}); export default connect(mapStateToProps)(FloatingLabelInput); diff --git a/src/components/Drawer.js b/src/components/Drawer.js index a3fa489..c7f294c 100644 --- a/src/components/Drawer.js +++ b/src/components/Drawer.js @@ -44,6 +44,10 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { const [dropdownHeight, setDropdownHeight] = useState(0); const navigation = useNavigation(); + const color = React.useMemo(() => { + return Colors.theme1[theme]; + }, [theme]); + const routes = React.useMemo(() => { return [ { @@ -338,7 +342,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { @@ -346,7 +350,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { setBoxPosition()} /> @@ -409,7 +413,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { ), { borderBottomWidth: 1, - borderColor: Colors.theme1[theme].grayE3, + borderColor: color.grayE3, height: dropdownHeight, }, ]} @@ -424,7 +428,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { style={{ fontSize: mobile ? fontSize.base : fontSize.xl, fontFamily: "regular", - color: Colors.theme1[theme].gray20, + color: color.gray20, }} > افزودن حساب کاربری جدید @@ -435,7 +439,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { marginTop: 3, fontSize: fontSize.xl4, fontFamily: "bold", - color: Colors.theme1[theme].gray20 + "77", + color: color.gray20 + "77", }} > + diff --git a/src/components/Empty.js b/src/components/Empty.js index 9e2542f..1ec0f37 100644 --- a/src/components/Empty.js +++ b/src/components/Empty.js @@ -16,13 +16,13 @@ const Empty = ({ text, buttonText, buttonAction, theme }) => { fontFamily: "regular", fontSize: fontSize.tiny, transform: [{ translateY: -50 }], - color : Colors.theme1[theme].gray20 + color: Colors.theme1[theme].gray20, }, ]} > {text + " " + ":("} - {buttonText && ( + {buttonText ? ( { {buttonText} - )} + ) : null} ); }; diff --git a/src/components/Navbar.js b/src/components/Navbar.js index 3c3f0ce..754ff85 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -81,14 +81,16 @@ const Navbar = ({ }, ]} > - {!headerOptions?.title && headerOptions?.back ? ( - navigation.goBack()} - /> + {!headerOptions?.title ? ( + headerOptions?.back ? ( + navigation.goBack()} + /> + ) : null ) : null} {headerOptions?.title ? ( ) : null} - {headerOptions?.hamburgerMenu && ( + {headerOptions?.hamburgerMenu ? ( setBoxPosition()}> - {notification && ( + {notification ? ( - )} + ) : null} - )} + ) : null} - {headerOptions?.logo && ( + {headerOptions?.logo ? ( navigation.navigate("Home")} style={tw("absolute right-1/2 top-1/2")} @@ -141,7 +143,7 @@ const Navbar = ({ xmlnsXlink="http://www.w3.org/1999/xlink" width={19.644} height={30.908} - style={{ transform: [{ translateY: -15.454 }, {scale: 1.3}] }} + style={{ transform: [{ translateY: -15.454 }, { scale: 1.3 }] }} > - )} + ) : null} - {headerOptions?.back && headerOptions?.title ? ( - navigation.goBack()} - /> + {headerOptions?.back ? ( + headerOptions?.title ? ( + navigation.goBack()} + /> + ) : null ) : null} - {headerOptions?.qr && ( + {headerOptions?.qr ? ( <>