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