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

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

@ -178,7 +178,6 @@ const ProductQuestion = ({ list, mobile, theme }) => {
return (
<View style={{ flex: 1 }}>
<View
onPress={() => refRBSheet.current.open()}
style={[
tw(
`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>
</View>
<Text
@ -253,10 +252,10 @@ const ProductReviews = ({ list, mobile, theme }) => {
textAlign: ios ? "right" : "auto",
}}
>
{question.text}
{question?.text}
</Text>
<View style={[tw("flex flex-row justify-between mt-4")]}>
{question.images.map((image, index) => (
{question?.images?.map((image, index) => (
<View
key={index}
style={[

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

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

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

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

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

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

Loading…
Cancel
Save