|
|
|
@ -31,7 +31,7 @@ function Commnets({ |
|
|
|
|
productId, |
|
|
|
|
getFullList, |
|
|
|
|
orderFullList, |
|
|
|
|
theme |
|
|
|
|
theme, |
|
|
|
|
}) { |
|
|
|
|
React.useEffect(() => { |
|
|
|
|
if (!orderFullList.length) { |
|
|
|
@ -50,11 +50,7 @@ function Commnets({ |
|
|
|
|
renderItem={({ item }) => <Comment comment={item} theme={theme} />} |
|
|
|
|
keyExtractor={(item) => item.id} |
|
|
|
|
/> |
|
|
|
|
<AddComment |
|
|
|
|
addComment={addComment} |
|
|
|
|
productId={productId} |
|
|
|
|
theme={theme} |
|
|
|
|
/> |
|
|
|
|
<AddComment addComment={addComment} productId={productId} theme={theme} /> |
|
|
|
|
</View> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -150,34 +146,45 @@ const AddComment = ({ addComment, productId, theme, ...props }) => { |
|
|
|
|
style={[ |
|
|
|
|
tw("w-full mt-4 px-2 rounded-md"), |
|
|
|
|
{ |
|
|
|
|
backgroundColor: theme === 'light' ? Colors.theme1.grayF9 : null, |
|
|
|
|
color: theme === 'light' ? Colors.theme1.gray20 : Colors.theme1.white, |
|
|
|
|
backgroundColor: theme === "light" ? Colors.theme1.grayF9 : null, |
|
|
|
|
color: |
|
|
|
|
theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, |
|
|
|
|
fontSize: fontSize.base, |
|
|
|
|
textAlign: "right", |
|
|
|
|
fontFamily: "light", |
|
|
|
|
borderWidth: 1, |
|
|
|
|
borderColor: theme === 'light' ? Colors.theme1.grayE3 : Colors.theme1.white + '55', |
|
|
|
|
height : fontSize.base + 30 |
|
|
|
|
borderColor: |
|
|
|
|
theme === "light" |
|
|
|
|
? Colors.theme1.grayE3 |
|
|
|
|
: Colors.theme1.white + "55", |
|
|
|
|
height: fontSize.base + 30, |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
value={comment.title} |
|
|
|
|
placeholder="عنوان نظر ..." |
|
|
|
|
onChangeText={(text) => setCommentForm({ ...commentForm, title: text })} |
|
|
|
|
placeholderTextColor={theme === 'light' ? Colors.theme1.gray2077 : Colors.theme1.white + 'aa'} |
|
|
|
|
placeholderTextColor={ |
|
|
|
|
theme === "light" |
|
|
|
|
? Colors.theme1.gray2077 |
|
|
|
|
: Colors.theme1.white + "aa" |
|
|
|
|
} |
|
|
|
|
/> |
|
|
|
|
<TextInput |
|
|
|
|
style={[ |
|
|
|
|
tw("w-full mt-4 py-4 px-2 rounded-md h-40"), |
|
|
|
|
{ |
|
|
|
|
backgroundColor: theme === 'light' ? Colors.theme1.grayF9 : null, |
|
|
|
|
color: theme === 'light' ? Colors.theme1.gray20 : Colors.theme1.white, |
|
|
|
|
backgroundColor: theme === "light" ? Colors.theme1.grayF9 : null, |
|
|
|
|
color: |
|
|
|
|
theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, |
|
|
|
|
fontSize: fontSize.tiny, |
|
|
|
|
textAlign: "right", |
|
|
|
|
fontFamily: "light", |
|
|
|
|
borderWidth: 1, |
|
|
|
|
|
|
|
|
|
borderColor: theme === 'light' ? Colors.theme1.grayE3 : Colors.theme1.white + '55', |
|
|
|
|
|
|
|
|
|
borderColor: |
|
|
|
|
theme === "light" |
|
|
|
|
? Colors.theme1.grayE3 |
|
|
|
|
: Colors.theme1.white + "55", |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
value={comment.text} |
|
|
|
@ -185,8 +192,13 @@ const AddComment = ({ addComment, productId, theme, ...props }) => { |
|
|
|
|
textAlignVertical="top" |
|
|
|
|
placeholder="متن نظر ..." |
|
|
|
|
onChangeText={(text) => setCommentForm({ ...commentForm, text })} |
|
|
|
|
placeholderTextColor={theme === 'light' ? Colors.theme1.gray2077 : Colors.theme1.white + 'aa'} |
|
|
|
|
placeholderTextColor={ |
|
|
|
|
theme === "light" |
|
|
|
|
? Colors.theme1.gray2077 |
|
|
|
|
: Colors.theme1.white + "aa" |
|
|
|
|
} |
|
|
|
|
/> |
|
|
|
|
{commentForm.title && commentForm.text ? ( |
|
|
|
|
<View style={tw("w-full mt-4")}> |
|
|
|
|
<Pressable |
|
|
|
|
title="ارسال نظر" |
|
|
|
@ -197,6 +209,7 @@ const AddComment = ({ addComment, productId, theme, ...props }) => { |
|
|
|
|
onPress={() => addComment(commentForm)} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
) : null} |
|
|
|
|
</KeyboardAvoidingView> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|