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