master
Reza_ashrafi 3 years ago
parent 6978496507
commit ad57dd813a
  1. 4
      src/screens/Product/components/Book.js
  2. 16
      src/screens/Product/components/Comments.js
  3. 7
      src/screens/Product/components/Info.js
  4. 1
      src/screens/Product/components/LinkBox.js
  5. 2
      src/screens/Product/components/Sample.js
  6. 10
      src/screens/Products/components/Main.js
  7. 2
      src/screens/Profile/components/MyCourses/index.js
  8. 18
      src/screens/Profile/components/ProfileAddress/index.js
  9. 4
      src/screens/Profile/components/ProfileBookmark/index.js

@ -92,7 +92,7 @@ function Book({
); );
React.useEffect(() => { React.useEffect(() => {
if (userProducts.length && whichTypeAdded) { if (userProducts?.length && whichTypeAdded) {
setTimeout(() => { setTimeout(() => {
if (whichTypeAdded === "video" && videoAvailabileInCart) { if (whichTypeAdded === "video" && videoAvailabileInCart) {
asyncAwesomeAlert("", "به سبد خرید اضافه شد", { asyncAwesomeAlert("", "به سبد خرید اضافه شد", {
@ -644,7 +644,7 @@ function Book({
}) })
} }
/> />
{product.rate || 4 ? ( {product?.rate || 4 ? (
<> <>
<View <View
style={tw( style={tw(

@ -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="ارسال نظر"

@ -178,7 +178,6 @@ const ProductQuestion = ({ list, mobile, theme }) => {
return ( return (
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<View <View
onPress={() => refRBSheet.current.open()}
style={[ style={[
tw( tw(
`flex flex-row-reverse justify-between items-center mt-3 rounded-md px-2 ${ `flex flex-row-reverse justify-between items-center mt-3 rounded-md px-2 ${
@ -241,7 +240,7 @@ const ProductReviews = ({ list, mobile, theme }) => {
}, },
]} ]}
> >
{question.title} {question?.title}
</Text> </Text>
</View> </View>
<Text <Text
@ -253,10 +252,10 @@ const ProductReviews = ({ list, mobile, theme }) => {
textAlign: ios ? "right" : "auto", textAlign: ios ? "right" : "auto",
}} }}
> >
{question.text} {question?.text}
</Text> </Text>
<View style={[tw("flex flex-row justify-between mt-4")]}> <View style={[tw("flex flex-row justify-between mt-4")]}>
{question.images.map((image, index) => ( {question?.images?.map((image, index) => (
<View <View
key={index} key={index}
style={[ style={[

@ -9,7 +9,6 @@ import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors"; import Colors from "../../../constants/Colors";
function Description({ title, onPress, mobile, theme }) { function Description({ title, onPress, mobile, theme }) {
const refRBSheet = useRef();
return ( return (
<TouchableOpacity <TouchableOpacity
onPress={() => onPress()} onPress={() => onPress()}

@ -27,7 +27,7 @@ const Sample = ({route}) => {
/> />
<WebView <WebView
source={{ source={{
uri: `https://dnvn.ir/xpdf/${route.params.id}`, uri: `https://dnvn.ir/xpdf/${route?.params?.id}`,
}} }}
style={{ flex: 1 }} style={{ flex: 1 }}
></WebView> ></WebView>

@ -46,14 +46,14 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => {
bySubjectFilter = byGradeFilter?.filter( bySubjectFilter = byGradeFilter?.filter(
(book) => (book) =>
book?.product[type]?.name?.indexOf(subject) !== -1 || book?.product[type]?.name?.indexOf(subject) !== -1 ||
book?.name.indexOf(subject) !== -1 book?.name?.indexOf(subject) !== -1
); );
} else { } else {
bySubjectFilter = byGradeFilter; bySubjectFilter = byGradeFilter;
} }
if (available) { if (available) {
byAvailableFilter = bySubjectFilter?.filter( byAvailableFilter = bySubjectFilter?.filter(
(book) => book.product[type].price (book) => book?.product[type]?.price
); );
} else { } else {
byAvailableFilter = bySubjectFilter; byAvailableFilter = bySubjectFilter;
@ -62,13 +62,13 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => {
bySearchFilter = byAvailableFilter?.filter( bySearchFilter = byAvailableFilter?.filter(
(book) => (book) =>
book?.product[type]?.name?.indexOf(search) !== -1 || book?.product[type]?.name?.indexOf(search) !== -1 ||
book?.name.indexOf(search) !== -1 book?.name?.indexOf(search) !== -1
); );
} else { } else {
bySearchFilter = byAvailableFilter; bySearchFilter = byAvailableFilter;
} }
return filterOptions.productType === "دوره ویدئویی" return filterOptions?.productType === "دوره ویدئویی"
? bySearchFilter?.map((product, index) => ( ? bySearchFilter?.map((product, index) => (
// <Pressable // <Pressable
// style={[ // style={[
@ -343,7 +343,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => {
}, },
]} ]}
> >
{separate(product?.product[0].price)} {separate(product?.product[0]?.price)}
</Text> </Text>
<Text <Text
style={{ style={{

@ -46,7 +46,7 @@ const ProfileBookmark = ({ myCourses = [], mobile, theme }) => {
back: true, back: true,
}} }}
/> />
{myCourses.length ? ( {myCourses?.length ? (
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container} style={styles.container}

@ -71,7 +71,7 @@ const ProfileAddress = ({
onPress={() => onPress={() =>
userAddressId === address?.id userAddressId === address?.id
? {} ? {}
: update({ userAddressId: address.id, userId }) : update({ userAddressId: address?.id, userId })
} }
> >
<View style={tw("flex flex-1 mr-2")}> <View style={tw("flex flex-1 mr-2")}>
@ -130,7 +130,7 @@ const ProfileAddress = ({
showCancelButton: true, showCancelButton: true,
confirmText: "بله", confirmText: "بله",
cancelText: "لغو", cancelText: "لغو",
onConfirm: () => deleteItem({ id: address.id }), onConfirm: () => deleteItem({ id: address?.id }),
}) })
} }
> >
@ -167,7 +167,7 @@ const ProfileAddress = ({
}, },
]} ]}
> >
{"آدرس:" + " " + address.address} {"آدرس:" + " " + address?.address}
</Text> </Text>
<Text <Text
style={[ style={[
@ -186,7 +186,7 @@ const ProfileAddress = ({
}, },
]} ]}
> >
{"نام:" + " " + address.firstName + " " + address.lastName} {"نام:" + " " + address?.firstName + " " + address?.lastName}
</Text> </Text>
<Text <Text
style={[ style={[
@ -205,7 +205,7 @@ const ProfileAddress = ({
}, },
]} ]}
> >
{"کد پستی:" + " " + address.postalCode} {"کد پستی:" + " " + address?.postalCode}
</Text> </Text>
<Text <Text
style={[ style={[
@ -224,7 +224,7 @@ const ProfileAddress = ({
}, },
]} ]}
> >
{"شماره تماس:" + " " + address.cellphone} {"شماره تماس:" + " " + address?.cellphone}
</Text> </Text>
</View> </View>
{!active ? ( {!active ? (
@ -248,7 +248,7 @@ const ProfileAddress = ({
showCancelButton: true, showCancelButton: true,
confirmText: "بله", confirmText: "بله",
cancelText: "لغو", cancelText: "لغو",
onConfirm: () => deleteItem({ id: address.id }), onConfirm: () => deleteItem({ id: address?.id }),
}) })
} }
> >
@ -310,7 +310,7 @@ const ProfileAddress = ({
back: true, back: true,
}} }}
/> />
{addresses.length > 0 ? ( {addresses?.length ? (
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={[styles.container]} style={[styles.container]}
@ -318,7 +318,7 @@ const ProfileAddress = ({
> >
<View style={tw("w-full mt-2 px-4")}> <View style={tw("w-full mt-2 px-4")}>
<View style={tw("p-0 m-0 flex ")}> <View style={tw("p-0 m-0 flex ")}>
{addresses.map((address, index) => ( {addresses?.map((address, index) => (
<Location <Location
address={address} address={address}
key={index} key={index}

@ -57,7 +57,7 @@ const ProfileBookmark = ({
back: true, back: true,
}} }}
/> />
{bookmarkList.length ? ( {bookmarkList?.length ? (
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container} style={styles.container}
@ -185,7 +185,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme, loading }) => {
<ActivityIndicator color={Colors.theme1.greenCF} size={30} /> <ActivityIndicator color={Colors.theme1.greenCF} size={30} />
) : ( ) : (
<Pressable <Pressable
onPress={() => deleteAction(deleteItem({ id: bookmark.id }))} onPress={() => deleteAction(deleteItem({ id: bookmark?.id }))}
> >
<Svg <Svg
data-name="vuesax/linear/archive-add" data-name="vuesax/linear/archive-add"

Loading…
Cancel
Save