From b1eb6c81ea3743e3de6c81a14868e547ff35a66a Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Sun, 10 Apr 2022 18:57:46 +0430 Subject: [PATCH] reza added some change --- src/screens/Product/components/Book.js | 1 + src/screens/Product/components/Comments.js | 20 +---- .../components/ProfileBookmark/index.js | 77 +++++++++++-------- src/screens/ShoppingCart/components/Code.js | 2 +- src/screens/ShoppingCart/index.js | 2 +- 5 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/screens/Product/components/Book.js b/src/screens/Product/components/Book.js index de6dd1c..f1706f7 100644 --- a/src/screens/Product/components/Book.js +++ b/src/screens/Product/components/Book.js @@ -70,6 +70,7 @@ function Book({ )[0]; }, [userProducts, book]); + return ( {!mobile && } diff --git a/src/screens/Product/components/Comments.js b/src/screens/Product/components/Comments.js index 1f7eb15..6855a32 100644 --- a/src/screens/Product/components/Comments.js +++ b/src/screens/Product/components/Comments.js @@ -37,7 +37,6 @@ function Commnets({ } }, []); - return ( ); @@ -127,7 +125,7 @@ const Comment = ({ comment }) => { ); }; -const AddComment = ({ addComment, productId, isBuyed, ...props }) => { +const AddComment = ({ addComment, productId, ...props }) => { const [commentForm, setCommentForm] = React.useState({ title: "", text: "", @@ -169,7 +167,7 @@ const AddComment = ({ addComment, productId, isBuyed, ...props }) => { ]} value={comment.title} placeholder="عنوان نظر ..." - onChangeText={(text) => setTitle(text)} + onChangeText={(text) => setCommentForm({...commentForm, title : text})} /> { value={comment.text} multiline={true} placeholder="متن نظر ..." - onChangeText={(text) => setText(text)} + onChangeText={(text) => setCommentForm({...commentForm, text})} /> { color={Colors.theme1[colorScheme].white} border={{ width: 0, color: null }} width={"40%"} - onPress={() => - isBuyed - ? addComment(commentForm) - : asyncAwesomeAlert( - "خطا", - "شما این محصول رو خریداری نکرده اید.", - { - showCancelButton: false, - } - ) - } + onPress={() => addComment(commentForm)} /> diff --git a/src/screens/Profile/components/ProfileBookmark/index.js b/src/screens/Profile/components/ProfileBookmark/index.js index 4c562b3..86082f6 100644 --- a/src/screens/Profile/components/ProfileBookmark/index.js +++ b/src/screens/Profile/components/ProfileBookmark/index.js @@ -13,7 +13,6 @@ import { } from "react-native"; import React from "react"; import { connect } from "react-redux"; -import { useNavigation } from "@react-navigation/native"; import Svg, { Path } from "react-native-svg"; import { userFavorite } from "../../../../redux/actions"; @@ -27,9 +26,6 @@ import tw from "tailwind-rn"; import Colors from "../../../../constants/Colors"; import fontSize from "../../../../constants/fontSize"; -//assets -import bookImage from "../../..//OrdersFollowUp/assets/b1.png"; - const { height, width } = Dimensions.get("window"); const ios = Platform.OS === "ios"; @@ -81,7 +77,7 @@ const ProfileBookmark = ({ )} - {bookmarkList.length > 0 ? ( + {bookmarkList.length ? ( { const colorScheme = Appearance.getColorScheme(); + + const isContent = React.useMemo(() => { + return bookmark?.content; + }); + return ( { - + - {bookmark.product.book.name} - - - {"پایه" + " " + grades[bookmark?.product?.book?.gradeId]} + {isContent ? bookmark?.content?.name : bookmark.product.book.name} + {!isContent && ( + + {"پایه" + " " + grades[bookmark?.product?.book?.gradeId]} + + )} deleteItem({ id: bookmark.id })}> @@ -207,13 +228,3 @@ const styles = StyleSheet.create({ paddingHorizontal: 0, }, }); - -// ProfileBookmark.defaultProps = { -// bookmarkList: [ -// { -// name: "کتاب آموزشی علوم تجربی", -// grade: "پایه ششم ابتدایی", -// image: bookImage, -// }, -// ], -// }; diff --git a/src/screens/ShoppingCart/components/Code.js b/src/screens/ShoppingCart/components/Code.js index e10bb74..f0874c6 100644 --- a/src/screens/ShoppingCart/components/Code.js +++ b/src/screens/ShoppingCart/components/Code.js @@ -45,7 +45,7 @@ function Code({ codeId, setCodeId, userId, factorId }) { placeholderTextColor={Colors.theme1[colorScheme].gray20 + 'aa'} /> setOff()} + onPress={() => setOff()} style={[ tw("py-3 px-5"), { diff --git a/src/screens/ShoppingCart/index.js b/src/screens/ShoppingCart/index.js index 439f7a7..ae39ef1 100644 --- a/src/screens/ShoppingCart/index.js +++ b/src/screens/ShoppingCart/index.js @@ -136,7 +136,7 @@ function ShoppingCart({ }} /> - {list?.filter((product) => product.condition < 2)?.length > 0 ? ( + {list?.filter((product) => product?.condition < 2)?.length ? (