|
|
@ -70,81 +70,82 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => { |
|
|
|
|
|
|
|
|
|
|
|
return filterOptions?.productType === "محصولات ویدیویی" |
|
|
|
return filterOptions?.productType === "محصولات ویدیویی" |
|
|
|
? bySearchFilter?.map((product, index) => ( |
|
|
|
? bySearchFilter?.map((product, index) => ( |
|
|
|
<Pressable |
|
|
|
<></> |
|
|
|
style={[ |
|
|
|
// <Pressable
|
|
|
|
{ |
|
|
|
// style={[
|
|
|
|
width: mobile ? "auto" : width / 2.2, |
|
|
|
// {
|
|
|
|
borderWidth: 1, |
|
|
|
// width: mobile ? "auto" : width / 2.2,
|
|
|
|
borderColor: |
|
|
|
// borderWidth: 1,
|
|
|
|
Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), |
|
|
|
// borderColor:
|
|
|
|
}, |
|
|
|
// 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} |
|
|
|
// ]}
|
|
|
|
onPress={() => navigation.navigate("Video", { id: product.id })} |
|
|
|
// key={index}
|
|
|
|
> |
|
|
|
// onPress={() => navigation.navigate("Video", { id: product.id })}
|
|
|
|
<View style={[tw("relative w-full mb-1")]}> |
|
|
|
// >
|
|
|
|
<Image |
|
|
|
// <View style={[tw("relative w-full mb-1")]}>
|
|
|
|
source={{ |
|
|
|
// <Image
|
|
|
|
uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`, |
|
|
|
// source={{
|
|
|
|
}} |
|
|
|
// uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`,
|
|
|
|
style={[ |
|
|
|
// }}
|
|
|
|
tw("w-full rounded-sm"), |
|
|
|
// style={[
|
|
|
|
{ height: ((mobile ? width - 25 : width / 2.2) * 9) / 16 }, |
|
|
|
// tw("w-full rounded-sm"),
|
|
|
|
]} |
|
|
|
// { 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: mobile ? fontSize.lg : fontSize.base, |
|
|
|
// 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: mobile ? fontSize.tiny : fontSize.sm, |
|
|
|
// 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: mobile ? fontSize.xl : fontSize.lg, |
|
|
|
// 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}> |
|
|
@ -205,7 +206,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => { |
|
|
|
: Colors.theme1.white, |
|
|
|
: Colors.theme1.white, |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
{ product?.name} |
|
|
|
{product?.name} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
@ -220,119 +221,8 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => { |
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
</View> |
|
|
|
</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> |
|
|
|
</Pressable> |
|
|
|
) : null} |
|
|
|
) : 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> |
|
|
|
</React.Fragment> |
|
|
|
)); |
|
|
|
)); |
|
|
|
}; |
|
|
|
}; |
|
|
|