|
|
@ -68,198 +68,200 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => { |
|
|
|
bySearchFilter = byAvailableFilter; |
|
|
|
bySearchFilter = byAvailableFilter; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return filterOptions?.productType === "دوره ویدئویی" |
|
|
|
return filterOptions?.productType === "محصولات ویدیویی" |
|
|
|
? bySearchFilter?.map((product, index) => ( |
|
|
|
? bySearchFilter?.map((product, index) => ( |
|
|
|
// <Pressable
|
|
|
|
<Pressable |
|
|
|
// style={[
|
|
|
|
style={[ |
|
|
|
// {
|
|
|
|
{ |
|
|
|
// width: mobile ? "auto" : width / 2.2,
|
|
|
|
width: mobile ? "auto" : width / 2.2, |
|
|
|
// borderWidth: 1,
|
|
|
|
borderWidth: 1, |
|
|
|
// borderColor:
|
|
|
|
borderColor: |
|
|
|
// Colors.theme1.grayE3 + (theme === "light" ? "" : "55"),
|
|
|
|
Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), |
|
|
|
// },
|
|
|
|
}, |
|
|
|
// tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`),
|
|
|
|
tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`), |
|
|
|
// ]}
|
|
|
|
]} |
|
|
|
// key={index}
|
|
|
|
key={index} |
|
|
|
// onPress={() => navigation.navigate("Video", { id: product.id })}
|
|
|
|
onPress={() => navigation.navigate("Video", { id: product.id })} |
|
|
|
// >
|
|
|
|
> |
|
|
|
// <View style={[tw("relative w-full mb-1")]}>
|
|
|
|
<View style={[tw("relative w-full mb-1")]}> |
|
|
|
// <Image
|
|
|
|
<Image |
|
|
|
// source={{
|
|
|
|
source={{ |
|
|
|
// uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`,
|
|
|
|
uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`, |
|
|
|
// }}
|
|
|
|
}} |
|
|
|
// style={[
|
|
|
|
style={[ |
|
|
|
// tw("w-full rounded-sm"),
|
|
|
|
tw("w-full rounded-sm"), |
|
|
|
// { height: ((mobile ? width - 25 : width / 2.2) * 9) / 16 },
|
|
|
|
{ height: ((mobile ? width - 25 : width / 2.2) * 9) / 16 }, |
|
|
|
// ]}
|
|
|
|
]} |
|
|
|
// />
|
|
|
|
/> |
|
|
|
// </View>
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
// <Text
|
|
|
|
<Text |
|
|
|
// style={[
|
|
|
|
style={[ |
|
|
|
// tw("mb-1"),
|
|
|
|
tw("mb-1"), |
|
|
|
// {
|
|
|
|
{ |
|
|
|
// fontFamily: "bold",
|
|
|
|
fontFamily: "bold", |
|
|
|
// fontSize: fontSize.lg,
|
|
|
|
fontSize: mobile ? fontSize.lg : fontSize.base, |
|
|
|
// color:
|
|
|
|
color: |
|
|
|
// theme === "light"
|
|
|
|
theme === "light" |
|
|
|
// ? Colors.theme1.gray20
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
// : Colors.theme1.white,
|
|
|
|
: Colors.theme1.white, |
|
|
|
// textAlign: ios ? "right" : "auto",
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
// },
|
|
|
|
}, |
|
|
|
// ]}
|
|
|
|
]} |
|
|
|
// >
|
|
|
|
> |
|
|
|
// {"دوره ویدئویی" + " " + product?.name}
|
|
|
|
{"دوره ویدئویی" + " " + product?.name} |
|
|
|
// </Text>
|
|
|
|
</Text> |
|
|
|
// <Text
|
|
|
|
<Text |
|
|
|
// style={[
|
|
|
|
style={[ |
|
|
|
// tw("mb-4"),
|
|
|
|
tw("mb-4"), |
|
|
|
// {
|
|
|
|
{ |
|
|
|
// fontSize: fontSize.tiny,
|
|
|
|
fontSize: mobile ? fontSize.tiny : fontSize.sm, |
|
|
|
// fontFamily: "regular",
|
|
|
|
fontFamily: "regular", |
|
|
|
// color: Colors.theme1.greenBA,
|
|
|
|
color: Colors.theme1.greenBA, |
|
|
|
// textAlign: ios ? "right" : "auto",
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
// },
|
|
|
|
}, |
|
|
|
// ]}
|
|
|
|
]} |
|
|
|
// >
|
|
|
|
> |
|
|
|
// {"پایه" + " " + grades[product?.gradeId]}
|
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
// </Text>
|
|
|
|
</Text> |
|
|
|
// <Text
|
|
|
|
<Text |
|
|
|
// style={[
|
|
|
|
style={[ |
|
|
|
// tw("w-full flex flex-row text-left"),
|
|
|
|
tw("w-full flex flex-row text-left"), |
|
|
|
// {
|
|
|
|
{ |
|
|
|
// fontSize: fontSize.xl,
|
|
|
|
fontSize: mobile ? fontSize.xl : fontSize.lg, |
|
|
|
// fontFamily: "bold",
|
|
|
|
fontFamily: "bold", |
|
|
|
// color:
|
|
|
|
color: |
|
|
|
// theme === "light"
|
|
|
|
theme === "light" |
|
|
|
// ? Colors.theme1.gray20
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
// : Colors.theme1.white,
|
|
|
|
: Colors.theme1.white, |
|
|
|
// },
|
|
|
|
}, |
|
|
|
// ]}
|
|
|
|
]} |
|
|
|
// >
|
|
|
|
> |
|
|
|
// {separate(
|
|
|
|
{separate( |
|
|
|
// product?.product?.filter(
|
|
|
|
product?.product?.filter( |
|
|
|
// (product) => product?.productType === 4
|
|
|
|
(product) => product?.productType === 4 |
|
|
|
// )[0].price
|
|
|
|
)[0].price |
|
|
|
// )}{" "}
|
|
|
|
)}{" "} |
|
|
|
// <Text style={{ fontSize: fontSize.sm }}>تومان</Text>
|
|
|
|
<Text style={{ fontSize: fontSize.sm }}>تومان</Text> |
|
|
|
// </Text>
|
|
|
|
</Text> |
|
|
|
// </Pressable>
|
|
|
|
</Pressable> |
|
|
|
<></> |
|
|
|
|
|
|
|
)) |
|
|
|
)) |
|
|
|
: bySearchFilter?.map((product, index) => ( |
|
|
|
: bySearchFilter?.map((product, index) => ( |
|
|
|
<React.Fragment key={index}> |
|
|
|
<React.Fragment key={index}> |
|
|
|
{( |
|
|
|
{( |
|
|
|
productType |
|
|
|
productType |
|
|
|
? productType === ("کتاب دیجیتال" || "همه محصولات") |
|
|
|
? productType === ("محصولات دیجیتال" || "همه محصولات") |
|
|
|
: true |
|
|
|
: true |
|
|
|
) ? ( |
|
|
|
) ? ( |
|
|
|
// <Pressable
|
|
|
|
<Pressable |
|
|
|
// key={product?.product[0]?.id}
|
|
|
|
key={product?.product[0]?.id} |
|
|
|
// style={[
|
|
|
|
style={[ |
|
|
|
// {
|
|
|
|
{ |
|
|
|
// width: mobile ? width / 2 - 25 : width / 3.2,
|
|
|
|
width: mobile |
|
|
|
// marginBottom: 15,
|
|
|
|
? width / 2 - 25 |
|
|
|
// borderWidth: 1,
|
|
|
|
: orientation === "portrait" |
|
|
|
// borderColor:
|
|
|
|
? width / 4.2 |
|
|
|
// Colors.theme1.grayE3 + (theme === "light" ? "" : "55"),
|
|
|
|
: width / 5.2, |
|
|
|
// },
|
|
|
|
marginBottom: 15, |
|
|
|
// tw("flex justify-between px-2 pt-2 rounded-md"),
|
|
|
|
borderWidth: 1, |
|
|
|
// ]}
|
|
|
|
borderColor: |
|
|
|
// onPress={() =>
|
|
|
|
Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), |
|
|
|
// navigation.navigate("Product", {
|
|
|
|
}, |
|
|
|
// id: product?.id,
|
|
|
|
tw("flex justify-between px-2 pt-2 rounded-md"), |
|
|
|
// type: "book",
|
|
|
|
]} |
|
|
|
// })
|
|
|
|
onPress={() => |
|
|
|
// }
|
|
|
|
navigation.navigate("Product", { |
|
|
|
// >
|
|
|
|
id: product?.id, |
|
|
|
// <View style={tw("w-full flex")}>
|
|
|
|
type: "book", |
|
|
|
// <Image
|
|
|
|
}) |
|
|
|
// resizeMode="contain"
|
|
|
|
} |
|
|
|
// source={{
|
|
|
|
> |
|
|
|
// uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`,
|
|
|
|
<View style={tw("w-full flex")}> |
|
|
|
// }}
|
|
|
|
<Image |
|
|
|
// style={[
|
|
|
|
resizeMode="contain" |
|
|
|
// tw("rounded-sm"),
|
|
|
|
source={{ |
|
|
|
// {
|
|
|
|
uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`, |
|
|
|
// flex: 1,
|
|
|
|
}} |
|
|
|
// height: mobile
|
|
|
|
style={[ |
|
|
|
// ? ((width / 2 - 25) * 4) / 2.9
|
|
|
|
tw("rounded-sm"), |
|
|
|
// : ((width / 3.2) * 16) / 14,
|
|
|
|
{ |
|
|
|
// },
|
|
|
|
flex: 1, |
|
|
|
// ]}
|
|
|
|
height: mobile |
|
|
|
// />
|
|
|
|
? ((width / 2 - 25) * 4) / 2.9 |
|
|
|
// <Text
|
|
|
|
: ((width / 3.2) * 16) / 16, |
|
|
|
// style={{
|
|
|
|
}, |
|
|
|
// fontSize: fontSize.base,
|
|
|
|
]} |
|
|
|
// marginTop: 5,
|
|
|
|
/> |
|
|
|
// fontFamily: "bold",
|
|
|
|
<Text |
|
|
|
// width: "100%",
|
|
|
|
style={{ |
|
|
|
// textAlign: ios ? "right" : "auto",
|
|
|
|
fontSize: mobile ? fontSize.base : fontSize.tiny, |
|
|
|
// color:
|
|
|
|
marginTop: 5, |
|
|
|
// theme === "light"
|
|
|
|
fontFamily: "bold", |
|
|
|
// ? Colors.theme1.gray20
|
|
|
|
width: "100%", |
|
|
|
// : Colors.theme1.white,
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
// }}
|
|
|
|
color: |
|
|
|
// >
|
|
|
|
theme === "light" |
|
|
|
// {"کتاب دیجیتال" + " " + product?.name}
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
// </Text>
|
|
|
|
: Colors.theme1.white, |
|
|
|
// <Text
|
|
|
|
}} |
|
|
|
// style={{
|
|
|
|
> |
|
|
|
// color: Colors.theme1.greenBA,
|
|
|
|
{"کتاب دیجیتال" + " " + product?.name} |
|
|
|
// fontSize: fontSize.tiny,
|
|
|
|
</Text> |
|
|
|
// marginTop: 5,
|
|
|
|
<Text |
|
|
|
// fontFamily: "regular",
|
|
|
|
style={{ |
|
|
|
// width: "100%",
|
|
|
|
color: Colors.theme1.greenBA, |
|
|
|
// textAlign: ios ? "right" : "auto",
|
|
|
|
fontSize: mobile ? fontSize.tiny : fontSize.sm, |
|
|
|
// }}
|
|
|
|
marginTop: 5, |
|
|
|
// >
|
|
|
|
fontFamily: "regular", |
|
|
|
// {"پایه" + " " + grades[product?.gradeId]}
|
|
|
|
width: "100%", |
|
|
|
// </Text>
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
// </View>
|
|
|
|
}} |
|
|
|
// <View
|
|
|
|
> |
|
|
|
// style={tw(
|
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
// "flex flex-row-reverse items-center justify-center pb-1 pt-2"
|
|
|
|
</Text> |
|
|
|
// )}
|
|
|
|
</View> |
|
|
|
// >
|
|
|
|
<View |
|
|
|
// <Text
|
|
|
|
style={tw( |
|
|
|
// style={[
|
|
|
|
"flex flex-row-reverse items-center justify-center pb-1 mt-3" |
|
|
|
// tw("text-center ml-1"),
|
|
|
|
)} |
|
|
|
// {
|
|
|
|
> |
|
|
|
// color:
|
|
|
|
<Text |
|
|
|
// theme === "light"
|
|
|
|
style={[ |
|
|
|
// ? Colors.theme1.gray20
|
|
|
|
tw("text-center ml-1"), |
|
|
|
// : Colors.theme1.white,
|
|
|
|
{ |
|
|
|
// fontFamily: "bold",
|
|
|
|
color: |
|
|
|
// fontSize: fontSize.xl2,
|
|
|
|
theme === "light" |
|
|
|
// },
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
// ]}
|
|
|
|
: Colors.theme1.white, |
|
|
|
// >
|
|
|
|
fontFamily: "bold", |
|
|
|
// {separate(
|
|
|
|
fontSize: mobile ? fontSize.xl2 : fontSize.lg, |
|
|
|
// product?.product?.filter(
|
|
|
|
}, |
|
|
|
// (product) => product?.productType === 1
|
|
|
|
]} |
|
|
|
// )[0]?.price
|
|
|
|
> |
|
|
|
// )}
|
|
|
|
{separate( |
|
|
|
// </Text>
|
|
|
|
product?.product?.filter( |
|
|
|
// <Text
|
|
|
|
(product) => product?.productType === 1 |
|
|
|
// style={{
|
|
|
|
)[0]?.price |
|
|
|
// fontSize: fontSize.sm,
|
|
|
|
)} |
|
|
|
// color:
|
|
|
|
</Text> |
|
|
|
// theme === "light"
|
|
|
|
<Text |
|
|
|
// ? Colors.theme1.gray20
|
|
|
|
style={{ |
|
|
|
// : Colors.theme1.white,
|
|
|
|
fontSize: fontSize.sm, |
|
|
|
// fontFamily: "regular",
|
|
|
|
color: |
|
|
|
// }}
|
|
|
|
theme === "light" |
|
|
|
// >
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
// تومان
|
|
|
|
: Colors.theme1.white, |
|
|
|
// </Text>
|
|
|
|
fontFamily: "regular", |
|
|
|
// </View>
|
|
|
|
}} |
|
|
|
// </Pressable>
|
|
|
|
> |
|
|
|
<></> |
|
|
|
تومان |
|
|
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
</Pressable> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
{( |
|
|
|
{( |
|
|
|
productType |
|
|
|
productType |
|
|
|
? productType === ("کتاب فیزیکی" || "همه محصولات") |
|
|
|
? productType === ("محصولات فیزیکی" || "همه محصولات") |
|
|
|
: true |
|
|
|
: true |
|
|
|
) ? ( |
|
|
|
) ? ( |
|
|
|
<Pressable |
|
|
|
<Pressable |
|
|
@ -297,15 +299,13 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => { |
|
|
|
flex: 1, |
|
|
|
flex: 1, |
|
|
|
height: mobile |
|
|
|
height: mobile |
|
|
|
? ((width / 2 - 25) * 4) / 2.9 |
|
|
|
? ((width / 2 - 25) * 4) / 2.9 |
|
|
|
: orientation === "portrait" |
|
|
|
: ((width / 3.2) * 16) / 16, |
|
|
|
? ((width / 4.2) * 16) / 11 |
|
|
|
|
|
|
|
: ((width / 5.2) * 16) / 11, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
]} |
|
|
|
]} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.base, |
|
|
|
fontSize: mobile ? fontSize.base : fontSize.tiny, |
|
|
|
marginTop: 5, |
|
|
|
marginTop: 5, |
|
|
|
color: |
|
|
|
color: |
|
|
|
theme === "light" |
|
|
|
theme === "light" |
|
|
@ -321,7 +321,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => { |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
color: Colors.theme1.greenBA, |
|
|
|
color: Colors.theme1.greenBA, |
|
|
|
fontSize: fontSize.tiny, |
|
|
|
fontSize: mobile ? fontSize.tiny : fontSize.sm, |
|
|
|
marginTop: 5, |
|
|
|
marginTop: 5, |
|
|
|
fontFamily: "regular", |
|
|
|
fontFamily: "regular", |
|
|
|
width: "100%", |
|
|
|
width: "100%", |
|
|
@ -333,7 +333,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => { |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View |
|
|
|
<View |
|
|
|
style={tw( |
|
|
|
style={tw( |
|
|
|
"flex flex-row-reverse items-center justify-center pb-1" |
|
|
|
"flex flex-row-reverse items-center justify-center pb-1 mt-2" |
|
|
|
)} |
|
|
|
)} |
|
|
|
> |
|
|
|
> |
|
|
|
<Text |
|
|
|
<Text |
|
|
@ -345,7 +345,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => { |
|
|
|
? Colors.theme1.gray20 |
|
|
|
? Colors.theme1.gray20 |
|
|
|
: Colors.theme1.white, |
|
|
|
: Colors.theme1.white, |
|
|
|
fontFamily: "bold", |
|
|
|
fontFamily: "bold", |
|
|
|
fontSize: fontSize.xl2, |
|
|
|
fontSize: mobile ? fontSize.xl2 : fontSize.lg, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]} |
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
@ -381,9 +381,9 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => { |
|
|
|
), |
|
|
|
), |
|
|
|
]} |
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
|
{/* {filterOptions?.productType === "دوره ویدئویی" ? Items(2) : null} */} |
|
|
|
{filterOptions?.productType === "محصولات ویدیویی" ? Items(2) : null} |
|
|
|
{/* {filterOptions?.productType === "کتاب دیجیتال" ? Items(0) : null} */} |
|
|
|
{filterOptions?.productType === "محصولات دیجیتال" ? Items(0) : null} |
|
|
|
{filterOptions?.productType === "کتاب فیزیکی" ? Items(1) : null} |
|
|
|
{filterOptions?.productType === "محصولات فیزیکی" ? Items(1) : null} |
|
|
|
{!filterOptions?.productType ? Items(0) : null} |
|
|
|
{!filterOptions?.productType ? Items(0) : null} |
|
|
|
{/* {filterLoading && ( |
|
|
|
{/* {filterLoading && ( |
|
|
|
<View style="w-full h-screen flex justify-center items-center bg-white bg-opacity-20 backdrop-filter backdrop-blur-xl fixed left-0 top-0"> |
|
|
|
<View style="w-full h-screen flex justify-center items-center bg-white bg-opacity-20 backdrop-filter backdrop-blur-xl fixed left-0 top-0"> |
|
|
|