diff --git a/App.js b/App.js index 1de4c75..9b96c3b 100644 --- a/App.js +++ b/App.js @@ -9,9 +9,9 @@ import store from './src/redux/store'; const App = () => { let [fontsLoaded] = useFonts({ - light : require("./assets/fonts/Farsi/IRANSansXFaNum-Light.ttf"), - regular: require("./assets/fonts/Farsi/IRANSansXFaNum-Regular.ttf"), - bold: require("./assets/fonts/Farsi/IRANSansXFaNum-Medium.ttf"), + light : require("./assets/fonts/Farsi/Light.ttf"), + regular: require("./assets/fonts/Farsi/Regular.ttf"), + bold: require("./assets/fonts/Farsi/Medium.ttf"), }); if (!fontsLoaded) { diff --git a/app.json b/app.json index 5034ef9..98db5e5 100644 --- a/app.json +++ b/app.json @@ -18,7 +18,8 @@ "**/*" ], "ios": { - "supportsTablet": true + "supportsTablet": true, + "bundleIdentifier": "com.appsazz.RnDanovinExpo" }, "android": { "adaptiveIcon": { diff --git a/assets/fonts/Farsi/IRANSansXFaNum-Light.ttf b/assets/fonts/Farsi/Light.ttf similarity index 100% rename from assets/fonts/Farsi/IRANSansXFaNum-Light.ttf rename to assets/fonts/Farsi/Light.ttf diff --git a/assets/fonts/Farsi/IRANSansXFaNum-Medium.ttf b/assets/fonts/Farsi/Medium.ttf similarity index 100% rename from assets/fonts/Farsi/IRANSansXFaNum-Medium.ttf rename to assets/fonts/Farsi/Medium.ttf diff --git a/assets/fonts/Farsi/IRANSansXFaNum-Regular.ttf b/assets/fonts/Farsi/Regular.ttf similarity index 100% rename from assets/fonts/Farsi/IRANSansXFaNum-Regular.ttf rename to assets/fonts/Farsi/Regular.ttf diff --git a/package.json b/package.json index c2bf518..6cbfcef 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "i18next": "^21.6.3", "install": "^0.13.0", "lodash": "^4.17.21", + "mapir-react-native-sdk": "^2.2.4", "react": "17.0.1", "react-dom": "17.0.1", "react-i18next": "^11.15.1", diff --git a/src/components/CustomTextInput.js b/src/components/CustomTextInput.js index 2d888dd..320d87f 100644 --- a/src/components/CustomTextInput.js +++ b/src/components/CustomTextInput.js @@ -35,18 +35,22 @@ const FloatingLabelInput = ({ labelStyle: { fontFamily: "regular", top: !isFocused ? "50%" : 1, - fontSize: !isFocused ? fontSize.lg : fontSize.sm, + fontSize: !isFocused ? fontSize.tiny : fontSize.sm, transform: [{ translateY: -width / 35 }], - color: !isFocused ? "#555" : Colors.theme1[colorScheme].green79, + color: !isFocused + ? Colors.theme1[colorScheme].gray2077 + : Colors.theme1[colorScheme].green79, }, inputStyle: { fontSize: fontSize.lg, - color: Colors.theme1[colorScheme].white, + color: Colors.theme1[colorScheme].black, borderWidth: 1, - borderColor: isFocused ? Colors.theme1[colorScheme].greenC8 : "#777", + borderColor: isFocused + ? Colors.theme1[colorScheme].greenC8 + : Colors.theme1[colorScheme].gray2077 + "66", textAlign: textAlign, fontFamily: "regular", - fontWeight : "900" + fontWeight: "900", }, }); return ( @@ -69,9 +73,7 @@ const FloatingLabelInput = ({ underlineColorAndroid={"transparent"} maxLength={maxLength} value={value} - onBlur={() => - value ? {} : setIsFocused(() => false) - } + onBlur={() => (value ? {} : setIsFocused(() => false))} /> ); diff --git a/src/components/Drawer.js b/src/components/Drawer.js index 3ce8afa..56cc65c 100644 --- a/src/components/Drawer.js +++ b/src/components/Drawer.js @@ -7,11 +7,19 @@ import { Pressable, Text, TouchableOpacity, + Image, + Appearance, } from "react-native"; import { useNavigation } from "@react-navigation/native"; import { Ionicons, AntDesign } from "@expo/vector-icons"; +import { connect } from "react-redux"; +import { user } from "../redux/actions"; +import Svg, { Path } from "react-native-svg"; + +//style import tw from "tailwind-rn"; import fontSize from "../constants/fontSize"; +import Colors from "../constants/Colors"; const width = Dimensions.get("window").width; const height = Dimensions.get("window").height; @@ -23,7 +31,8 @@ if ( UIManager.setLayoutAnimationEnabledExperimental(true); } -const Drawer = ({ position, setBoxPosition }) => { +const Drawer = ({ position, setBoxPosition, user }) => { + const colorScheme = Appearance.getColorScheme(); const [routes, setRoutes] = useState([ { name: "صفحه اصلی", @@ -82,6 +91,7 @@ const Drawer = ({ position, setBoxPosition }) => { message: "", }, ]); + const [addUserDropdown, setAddUserDropdown] = useState(false); const navigation = useNavigation(); const Route = ({ route }) => { return ( @@ -94,13 +104,17 @@ const Drawer = ({ position, setBoxPosition }) => { > {route.icon} {route.name} ); }; + return ( { left: position, width: width, height: height, - zIndex : 10000 + zIndex: 10000, }, ]} > setBoxPosition()} - style={[tw(`w-1/5 h-full ${position === "0%" ? "bg-black bg-opacity-40" : ""}`)]} + style={[ + tw( + `w-1/5 h-full ${position === "0%" ? "bg-black bg-opacity-40" : ""}` + ), + ]} > - - {routes.map((route, index) => ( - - ))} + + + {user.picFileId ? ( + + ) : ( + + )} + + + + {user?.firstName + " " + user?.lastName} + + + {user?.cellphone} + + + setAddUserDropdown(() => !addUserDropdown)} + > + + + + + + {routes.map((route, index) => ( + + ))} + ); }; -export default Drawer; +const mapStateToProps = (state) => ({ + user: JSON.parse(state.user.status), +}); + +const mapDispatchToProps = { + logout: user.logout, +}; + +export default connect(mapStateToProps)(Drawer); diff --git a/src/components/MapSelector.js b/src/components/MapSelector.js new file mode 100644 index 0000000..e025a91 --- /dev/null +++ b/src/components/MapSelector.js @@ -0,0 +1,31 @@ +import React, {Component} from 'react'; +import { SafeAreaView, StyleSheet, View} from 'react-native'; +// import Mapir from 'mapir-react-native-sdk' + +const X_API_KEY = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjkyODE4ODI0N2FhMjdlYTMyMzVlYzRiOWUxZDI3NTQyZTNjYmI3ZjQzY2Q2NGQzYjdkYjU1NmY3NDM5YzU2NzUyNzMxMjAzYzMwOTliYTFiIn0.eyJhdWQiOiIxNjk2MSIsImp0aSI6IjkyODE4ODI0N2FhMjdlYTMyMzVlYzRiOWUxZDI3NTQyZTNjYmI3ZjQzY2Q2NGQzYjdkYjU1NmY3NDM5YzU2NzUyNzMxMjAzYzMwOTliYTFiIiwiaWF0IjoxNjQ0MzE3MDA5LCJuYmYiOjE2NDQzMTcwMDksImV4cCI6MTY0NjgyMjYwOSwic3ViIjoiIiwic2NvcGVzIjpbImJhc2ljIl19.Gckmd77Vw-wmsaztsmVmjYmfp4zXRSy2f0tXS-1p7IY8VJmvCCrk64y7WvCLbH0YfGZI9rG9ZUi5hRJDDGXu70l1ZafCYq2-EkMzcbx-PGTTq2bHGNZujF4ur1xtGoXd2kwGuldiR_6SJdqYLHcupbscFI7hHaQnkN1xWJ-L8476ZOKzUgiBvwH9uElGZXwD6SwfXoGW_R38_isrnfTXKfW9PPixyLaN3404tcjOU1r02HIurrplXlIKRKG9CVXxKsESfJJ8trwtZw6O4erxrnisxfL0VwAR7l69P6KcFb57vvM4j4hKFqxUDr4YvSq1qOTt3urYbAKehhvoiLhZxw"; + +export default function MapSelector() { + onRegionDidChange = (e) => { + console.log('onRegionDidChange', e.geometry.coordinates); + }; + return ( + + {/* onRegionDidChange(e)} + style={styles.container} + /> */} + {/* + */} + + ); +} + +const styles = StyleSheet.create({ + container: { + width : '100%', height: 300 + }, +}); \ No newline at end of file diff --git a/src/components/Navbar.js b/src/components/Navbar.js index 135af3d..d24cd4d 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -217,7 +217,7 @@ const Navbar = ({ notification, setBoxPosition, headerOptions }) => { diff --git a/src/components/Select.js b/src/components/Select.js index 04c9178..f9e6449 100644 --- a/src/components/Select.js +++ b/src/components/Select.js @@ -25,8 +25,8 @@ function Select({ borderWidth: 1, borderColor: Colors.theme1[colorScheme].gray2077 + "66", borderRadius: 6, - height: 36, - backgroundColor: Colors.theme1[colorScheme].grayF9, + height: 48, + backgroundColor: 'white', fontFamily: "regular", }} rowTextStyle={{ @@ -39,7 +39,7 @@ function Select({ textAlign: "center", justifyContent: "flex-end", flex: 0, - fontSize: fontSize.sm, + fontSize: fontSize.tiny, color: Colors.theme1[colorScheme].gray2077, fontFamily: "regular", // display: 'inline' diff --git a/src/redux/reducers/user.js b/src/redux/reducers/user.js index b4966ce..156bc06 100644 --- a/src/redux/reducers/user.js +++ b/src/redux/reducers/user.js @@ -43,7 +43,7 @@ const user = (state = initialState, action) => { return { ...state, loading: false, - status: data, + status: JSON.parse(data), error: null, setDone: false, }; diff --git a/src/redux/store.js b/src/redux/store.js index 8725c70..4741be7 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -62,7 +62,7 @@ try { ReactNative.I18nManager.allowRTL(false); // enableScreens(); } catch (e) { - // console.log(e); + console.log(e); } console.disableYellowBox = true; diff --git a/src/screens/Address/index.js b/src/screens/Address/index.js index 6d8f449..4e80ab5 100644 --- a/src/screens/Address/index.js +++ b/src/screens/Address/index.js @@ -20,6 +20,7 @@ import Navbar from "../../components/Navbar"; import CustomPressable from "../../components/Pressable"; import CustomTextInput from "../../components/CustomTextInput"; import Select from "../../components/Select"; +import MapSelector from "../../components/MapSelector"; //style import tw from "tailwind-rn"; @@ -48,12 +49,6 @@ const Address = ({ getProvince(); }, []); - useEffect(() => { - // if(provinces?.length > 0){ - console.log(province); - // } - }, [province]); - useEffect(() => { if (addressFields?.provinceId) { getCity({ @@ -186,6 +181,7 @@ const Address = ({ style={styles.container} > +
+ + onChange(name, value)} + autoFocus={false} + regex={(val) => val} + /> + { navigation.navigate("Product")} > @@ -44,7 +56,7 @@ function Scroll({ books }) { ); }; return ( - + ({ -}); +const mapStateToProps = (state) => ({}); export default connect(mapStateToProps, {})(Scroll); diff --git a/src/screens/Home/index.js b/src/screens/Home/index.js index 15571c7..4a5c036 100644 --- a/src/screens/Home/index.js +++ b/src/screens/Home/index.js @@ -45,7 +45,7 @@ const Home = ({ LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); setPosition(position === "100%" ? "0%" : "100%"); }; - + return ( { - // if (props.isLogin) { - // props.navigation.navigate('Root'); - // } - // }, [props.isLogin]); + useEffect(() => { + if (props.isLogin) { + props.navigation.navigate('Root'); + } + }, [props.isLogin]); return ( @@ -129,7 +132,7 @@ function Otp(props) { />