From 53be7eb7efb3a5624a8539ce8e94b197f9200d05 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Sat, 28 May 2022 01:21:53 +0430 Subject: [PATCH] update 7 files --- app.json | 14 ++++-- src/assets/images/poster.png | Bin 0 -> 401 bytes src/redux/proxy.js | 7 ++- src/screens/Address/index.js | 60 ++++++++++++------------- src/screens/Product/components/Book.js | 2 +- src/screens/Profile/components/User.js | 1 + src/screens/ShoppingCart/index.js | 3 +- src/screens/VideoDisplay/index.js | 30 ++++++++++++- 8 files changed, 78 insertions(+), 39 deletions(-) create mode 100644 src/assets/images/poster.png diff --git a/app.json b/app.json index c845742..811bf95 100644 --- a/app.json +++ b/app.json @@ -15,9 +15,7 @@ "updates": { "fallbackToCacheTimeout": 0 }, - "assetBundlePatterns": [ - "**/*" - ], + "assetBundlePatterns": ["**/*"], "ios": { "supportsTablet": true, "bundleIdentifier": "com.appsazz.RnDanovinExpo" @@ -32,6 +30,14 @@ "web": { "favicon": "" }, - "description": "" + "description": "", + "plugins": [ + [ + "expo-image-picker", + { + "photosPermission": "photosPermission" + } + ] + ] } } diff --git a/src/assets/images/poster.png b/src/assets/images/poster.png new file mode 100644 index 0000000000000000000000000000000000000000..c5cd37d70f487b30f3af2a2c188d0e89e75cf69d GIT binary patch literal 401 zcmV;C0dD?@P)p(4s~31ie7- z&;v-eawF|q8H5SZxCkP~8q;w4zOo!+u=z>Hg^SuqXLGsSd(VM$F5?Y=e}I{kz;=7S z92*e)IuSv?-v`UGXwoXCgR6KYWJFM_)ewn9U>F7nq2PHQ+}s!LdKZvCH+>~pjzbhh zoK%lsi!M4r2?yLB7*$oh**K3E(!kq;>n~@s8z>acu##8;7YHJmOhVH%SeAub=NQ+a z5L_C@p|C$DcsB_?>LWMP=@d$(5=^r { try { + console.log(url.split("/")[0] === 'file'); dispatch = dispatch || (() => {}); dispatch({ type: url.split("/")[0] + "/" + "loading" }); let response = await fetch(); + if(url.split("/")[0] === 'file'){ + console.log('response'); + console.log(response); + } // console.log(response); switch (response.status) { case 200: @@ -84,7 +89,7 @@ class Proxy { }); } return false; - } catch (error) {} + } catch (error) {console.log(error)} }; refresh = () => { diff --git a/src/screens/Address/index.js b/src/screens/Address/index.js index 6e2e7e2..507a70d 100644 --- a/src/screens/Address/index.js +++ b/src/screens/Address/index.js @@ -152,18 +152,18 @@ const Address = ({ id, } = addressFields; - if (!firstName) { - return asyncAwesomeAlert("خطا", "نام خود را وارد کنید.", { - showCancelButton: false, - confirmText: "باشه", - }); - } - if (!lastName) { - return asyncAwesomeAlert("خطا", "نام خانوادگی خود را وارد کنید", { - showCancelButton: false, - confirmText: "باشه", - }); - } + // if (!firstName) { + // return asyncAwesomeAlert("خطا", "نام خود را وارد کنید.", { + // showCancelButton: false, + // confirmText: "باشه", + // }); + // } + // if (!lastName) { + // return asyncAwesomeAlert("خطا", "نام خانوادگی خود را وارد کنید", { + // showCancelButton: false, + // confirmText: "باشه", + // }); + // } if (!cellphone) { return asyncAwesomeAlert("خطا", "شماره موبایل خود را وارد کنید.", { showCancelButton: false, @@ -192,23 +192,23 @@ const Address = ({ } } - if (!phone) { - return asyncAwesomeAlert("خطا", "شماره تلفن خود را وارد کنید.", { - showCancelButton: false, - confirmText: "باشه", - }); - } else { - if (phone.slice(0, 1) !== "0") { - return asyncAwesomeAlert( - "خطا", - "فرمت شماره تلفن وارد شده اشتباه است.", - { - showCancelButton: false, - confirmText: "باشه", - } - ); - } - } + // if (!phone) { + // return asyncAwesomeAlert("خطا", "شماره تلفن خود را وارد کنید.", { + // showCancelButton: false, + // confirmText: "باشه", + // }); + // } else { + // if (phone.slice(0, 1) !== "0") { + // return asyncAwesomeAlert( + // "خطا", + // "فرمت شماره تلفن وارد شده اشتباه است.", + // { + // showCancelButton: false, + // confirmText: "باشه", + // } + // ); + // } + // } if (!provinceId) { return asyncAwesomeAlert("خطا", "نام استان خود را وارد کنید.", { @@ -229,7 +229,7 @@ const Address = ({ }); } else { if (postalCode.length !== 10) { - return asyncAwesomeAlert("خطا", "کد ملی میبایست ده رقم باشد.", { + return asyncAwesomeAlert("خطا", "کد پستی میبایست ده رقم باشد.", { showCancelButton: false, confirmText: "باشه", }); diff --git a/src/screens/Product/components/Book.js b/src/screens/Product/components/Book.js index dae41a6..8df929b 100644 --- a/src/screens/Product/components/Book.js +++ b/src/screens/Product/components/Book.js @@ -92,7 +92,7 @@ function Book({ const addToCart = React.useCallback( async (action, type) => { setWhichTypeAdded(type); - await action(); + action(); }, [book, userId] ); diff --git a/src/screens/Profile/components/User.js b/src/screens/Profile/components/User.js index 1be0811..b1ae28f 100644 --- a/src/screens/Profile/components/User.js +++ b/src/screens/Profile/components/User.js @@ -20,6 +20,7 @@ const { width } = Dimensions.get("window"); const User = ({ user, mobile, theme, upload }) => { const [dropdown, setDropdown] = React.useState(true); const [image, setImage] = React.useState(null); + const [status, requestPermission] = ImagePicker.useMediaLibraryPermissions(); const navigation = useNavigation(); const pickImage = React.useCallback(async () => { diff --git a/src/screens/ShoppingCart/index.js b/src/screens/ShoppingCart/index.js index bec6546..aa10a44 100644 --- a/src/screens/ShoppingCart/index.js +++ b/src/screens/ShoppingCart/index.js @@ -221,8 +221,9 @@ function ShoppingCart({ }, ]} > - {isEmpty ? 0 : separate(factorInfo?.payPrice - factorInfo?.transportPrice)} + {isEmpty ? 0 : separate(factorInfo?.payPrice)} +