|
|
|
@ -22,7 +22,7 @@ import tw from "tailwind-rn"; |
|
|
|
|
import fontSize from "../../../constants/fontSize"; |
|
|
|
|
import Colors from "../../../constants/Colors"; |
|
|
|
|
|
|
|
|
|
const {width} = Dimensions.get("window"); |
|
|
|
|
const { width } = Dimensions.get("window"); |
|
|
|
|
const ios = Platform.OS === "ios"; |
|
|
|
|
|
|
|
|
|
function Commnets({ |
|
|
|
@ -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,53 +146,70 @@ 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'} |
|
|
|
|
onChangeText={(text) => setCommentForm({ ...commentForm, title: text })} |
|
|
|
|
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} |
|
|
|
|
multiline={true} |
|
|
|
|
textAlignVertical="top" |
|
|
|
|
placeholder="متن نظر ..." |
|
|
|
|
onChangeText={(text) => setCommentForm({...commentForm, text})} |
|
|
|
|
placeholderTextColor={theme === 'light' ? Colors.theme1.gray2077 : Colors.theme1.white + 'aa'} |
|
|
|
|
onChangeText={(text) => setCommentForm({ ...commentForm, text })} |
|
|
|
|
placeholderTextColor={ |
|
|
|
|
theme === "light" |
|
|
|
|
? Colors.theme1.gray2077 |
|
|
|
|
: Colors.theme1.white + "aa" |
|
|
|
|
} |
|
|
|
|
/> |
|
|
|
|
<View style={tw("w-full mt-4")}> |
|
|
|
|
<Pressable |
|
|
|
|
title="ارسال نظر" |
|
|
|
|
backgroundColor={Colors.theme1.greenCF} |
|
|
|
|
color={Colors.theme1.white} |
|
|
|
|
border={{ width: 0, color: null }} |
|
|
|
|
width={"40%"} |
|
|
|
|
onPress={() => addComment(commentForm)} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
{commentForm.title && commentForm.text ? ( |
|
|
|
|
<View style={tw("w-full mt-4")}> |
|
|
|
|
<Pressable |
|
|
|
|
title="ارسال نظر" |
|
|
|
|
backgroundColor={Colors.theme1.greenCF} |
|
|
|
|
color={Colors.theme1.white} |
|
|
|
|
border={{ width: 0, color: null }} |
|
|
|
|
width={"40%"} |
|
|
|
|
onPress={() => addComment(commentForm)} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
) : null} |
|
|
|
|
</KeyboardAvoidingView> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|