|
|
|
@ -34,7 +34,7 @@ function Commnets({ |
|
|
|
|
theme, |
|
|
|
|
}) { |
|
|
|
|
React.useEffect(() => { |
|
|
|
|
if (!orderFullList.length) { |
|
|
|
|
if (!orderFullList?.length) { |
|
|
|
|
getFullList(); |
|
|
|
|
} |
|
|
|
|
}, []); |
|
|
|
@ -48,7 +48,7 @@ function Commnets({ |
|
|
|
|
style={{ marginTop: 20, paddingBottom: 10 }} |
|
|
|
|
data={comments} |
|
|
|
|
renderItem={({ item }) => <Comment comment={item} theme={theme} />} |
|
|
|
|
keyExtractor={(item) => item.id} |
|
|
|
|
keyExtractor={(item) => item?.id} |
|
|
|
|
/> |
|
|
|
|
<AddComment addComment={addComment} productId={productId} theme={theme} /> |
|
|
|
|
</View> |
|
|
|
@ -66,7 +66,7 @@ const Comment = ({ comment, theme }) => { |
|
|
|
|
<View style={[tw("flex flex-row-reverse justify-between items-center")]}> |
|
|
|
|
<View style={tw("flex flex-row-reverse items-center")}> |
|
|
|
|
<Image |
|
|
|
|
source={comment.imageUrl} |
|
|
|
|
source={comment?.imageUrl} |
|
|
|
|
style={[tw("rounded-full"), { width: 35, height: 35 }]} |
|
|
|
|
/> |
|
|
|
|
<Text |
|
|
|
@ -75,7 +75,7 @@ const Comment = ({ comment, theme }) => { |
|
|
|
|
, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
{comment.name} |
|
|
|
|
{comment?.name} |
|
|
|
|
</Text> |
|
|
|
|
</View> |
|
|
|
|
<View style={tw("flex flex-row items-center")}> |
|
|
|
@ -118,7 +118,7 @@ const Comment = ({ comment, theme }) => { |
|
|
|
|
tw("mt-2"), |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
{comment.message} |
|
|
|
|
{comment?.message} |
|
|
|
|
</Text> |
|
|
|
|
</View> |
|
|
|
|
); |
|
|
|
@ -160,7 +160,7 @@ const AddComment = ({ addComment, productId, theme, ...props }) => { |
|
|
|
|
height: fontSize.base + 30, |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
value={comment.title} |
|
|
|
|
value={comment?.title} |
|
|
|
|
placeholder="عنوان نظر ..." |
|
|
|
|
onChangeText={(text) => setCommentForm({ ...commentForm, title: text })} |
|
|
|
|
placeholderTextColor={ |
|
|
|
@ -187,7 +187,7 @@ const AddComment = ({ addComment, productId, theme, ...props }) => { |
|
|
|
|
: Colors.theme1.white + "55", |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
value={comment.text} |
|
|
|
|
value={comment?.text} |
|
|
|
|
multiline={true} |
|
|
|
|
textAlignVertical="top" |
|
|
|
|
placeholder="متن نظر ..." |
|
|
|
@ -198,7 +198,7 @@ const AddComment = ({ addComment, productId, theme, ...props }) => { |
|
|
|
|
: Colors.theme1.white + "aa" |
|
|
|
|
} |
|
|
|
|
/> |
|
|
|
|
{commentForm.title && commentForm.text ? ( |
|
|
|
|
{commentForm?.title && commentForm?.text ? ( |
|
|
|
|
<View style={tw("w-full mt-4")}> |
|
|
|
|
<Pressable |
|
|
|
|
title="ارسال نظر" |
|
|
|
|