|
|
@ -5,6 +5,7 @@ import { |
|
|
|
Image, |
|
|
|
Image, |
|
|
|
Dimensions, |
|
|
|
Dimensions, |
|
|
|
Appearance, |
|
|
|
Appearance, |
|
|
|
|
|
|
|
Platform, |
|
|
|
} from "react-native"; |
|
|
|
} from "react-native"; |
|
|
|
import React from "react"; |
|
|
|
import React from "react"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { connect } from "react-redux"; |
|
|
@ -17,6 +18,7 @@ import Colors from "../../../constants/Colors"; |
|
|
|
import fontSize from "../../../constants/fontSize"; |
|
|
|
import fontSize from "../../../constants/fontSize"; |
|
|
|
|
|
|
|
|
|
|
|
const width = Dimensions.get("window").width; |
|
|
|
const width = Dimensions.get("window").width; |
|
|
|
|
|
|
|
const ios = Platform.OS === "ios"; |
|
|
|
|
|
|
|
|
|
|
|
const Main = ({ books, filterOptions, grades }) => { |
|
|
|
const Main = ({ books, filterOptions, grades }) => { |
|
|
|
const colorScheme = Appearance.getColorScheme(); |
|
|
|
const colorScheme = Appearance.getColorScheme(); |
|
|
@ -90,15 +92,35 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={[ |
|
|
|
style={[ |
|
|
|
tw("mb-1"), |
|
|
|
tw("mb-1"), |
|
|
|
{ fontFamily: "bold", fontSize: fontSize.xl2, color : Colors.theme1[colorScheme].gray20 }, |
|
|
|
{ |
|
|
|
|
|
|
|
fontFamily: "bold", |
|
|
|
|
|
|
|
fontSize: fontSize.lg, |
|
|
|
|
|
|
|
color: Colors.theme1[colorScheme].gray20, |
|
|
|
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
|
|
|
|
}, |
|
|
|
]} |
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
|
{'دوره ویدئویی' + ' ' + product?.name} |
|
|
|
{"دوره ویدئویی" + " " + product?.name} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
<Text style={[tw("mb-4"), { fontSize: fontSize.tiny, fontFamily : 'regular', color : Colors.theme1[colorScheme].greenBA }]}> |
|
|
|
<Text |
|
|
|
|
|
|
|
style={[ |
|
|
|
|
|
|
|
tw("mb-4"), |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
fontSize: fontSize.tiny, |
|
|
|
|
|
|
|
fontFamily: "regular", |
|
|
|
|
|
|
|
color: Colors.theme1[colorScheme].greenBA, |
|
|
|
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
> |
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
<Text style={[tw("w-full flex flex-row text-left"), {fontSize : fontSize.xl, fontFamily : 'bold'}]}> |
|
|
|
<Text |
|
|
|
|
|
|
|
style={[ |
|
|
|
|
|
|
|
tw("w-full flex flex-row text-left"), |
|
|
|
|
|
|
|
{ fontSize: fontSize.xl, fontFamily: "bold" }, |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
> |
|
|
|
{separate(product?.product[2]?.price) + " " + "تومان"} |
|
|
|
{separate(product?.product[2]?.price) + " " + "تومان"} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
</Pressable> |
|
|
|
</Pressable> |
|
|
@ -120,7 +142,10 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
tw("flex justify-between px-2 pt-2 rounded-md"), |
|
|
|
tw("flex justify-between px-2 pt-2 rounded-md"), |
|
|
|
]} |
|
|
|
]} |
|
|
|
onPress={() => |
|
|
|
onPress={() => |
|
|
|
navigation.navigate("Product", { id: product?.id, type: "book" }) |
|
|
|
navigation.navigate("Product", { |
|
|
|
|
|
|
|
id: product?.id, |
|
|
|
|
|
|
|
type: "book", |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
> |
|
|
|
> |
|
|
|
<View style={tw("w-full flex")}> |
|
|
|
<View style={tw("w-full flex")}> |
|
|
@ -135,11 +160,12 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
/> |
|
|
|
/> |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.lg, |
|
|
|
fontSize: fontSize.base, |
|
|
|
marginTop: 5, |
|
|
|
marginTop: 5, |
|
|
|
color: "#05335F", |
|
|
|
color: "#05335F", |
|
|
|
fontFamily: "bold", |
|
|
|
fontFamily: "bold", |
|
|
|
width: "100%", |
|
|
|
width: "100%", |
|
|
|
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
{"کتاب دیجیتال" + " " + product?.name} |
|
|
|
{"کتاب دیجیتال" + " " + product?.name} |
|
|
@ -151,6 +177,7 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
marginTop: 5, |
|
|
|
marginTop: 5, |
|
|
|
fontFamily: "regular", |
|
|
|
fontFamily: "regular", |
|
|
|
width: "100%", |
|
|
|
width: "100%", |
|
|
|
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
@ -176,7 +203,7 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.sm, |
|
|
|
fontSize: fontSize.sm, |
|
|
|
color: Colors.theme1[colorScheme].grayCC, |
|
|
|
color: Colors.theme1[colorScheme].gray2077, |
|
|
|
fontFamily: "regular", |
|
|
|
fontFamily: "regular", |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
@ -200,7 +227,10 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
tw("flex justify-between px-2 pt-2 rounded-md"), |
|
|
|
tw("flex justify-between px-2 pt-2 rounded-md"), |
|
|
|
]} |
|
|
|
]} |
|
|
|
onPress={() => |
|
|
|
onPress={() => |
|
|
|
navigation.navigate("Product", { id: product?.id, type: "book" }) |
|
|
|
navigation.navigate("Product", { |
|
|
|
|
|
|
|
id: product?.id, |
|
|
|
|
|
|
|
type: "book", |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
> |
|
|
|
> |
|
|
|
<View style={tw("w-full flex")}> |
|
|
|
<View style={tw("w-full flex")}> |
|
|
@ -215,11 +245,12 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
/> |
|
|
|
/> |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.lg, |
|
|
|
fontSize: fontSize.base, |
|
|
|
marginTop: 5, |
|
|
|
marginTop: 5, |
|
|
|
color: "#05335F", |
|
|
|
color: "#05335F", |
|
|
|
fontFamily: "bold", |
|
|
|
fontFamily: "bold", |
|
|
|
width: "100%", |
|
|
|
width: "100%", |
|
|
|
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
{"کتاب فیزیکی" + " " + product?.name} |
|
|
|
{"کتاب فیزیکی" + " " + product?.name} |
|
|
@ -231,6 +262,7 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
marginTop: 5, |
|
|
|
marginTop: 5, |
|
|
|
fontFamily: "regular", |
|
|
|
fontFamily: "regular", |
|
|
|
width: "100%", |
|
|
|
width: "100%", |
|
|
|
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
@ -256,7 +288,7 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.sm, |
|
|
|
fontSize: fontSize.sm, |
|
|
|
color: Colors.theme1[colorScheme].grayCC, |
|
|
|
color: Colors.theme1[colorScheme].gray2077, |
|
|
|
fontFamily: "regular", |
|
|
|
fontFamily: "regular", |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
@ -271,9 +303,11 @@ const Main = ({ books, filterOptions, grades }) => { |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<View |
|
|
|
<View |
|
|
|
style={[tw( |
|
|
|
style={[ |
|
|
|
|
|
|
|
tw( |
|
|
|
"flex w-full px-4 flex-row flex-wrap justify-between bg-white pb-20" |
|
|
|
"flex w-full px-4 flex-row flex-wrap justify-between bg-white pb-20" |
|
|
|
)]} |
|
|
|
), |
|
|
|
|
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
|
{filterOptions?.productType === "دوره ویدئویی" && Items(2)} |
|
|
|
{filterOptions?.productType === "دوره ویدئویی" && Items(2)} |
|
|
|
{filterOptions?.productType === "کتاب دیجیتال" && Items(0)} |
|
|
|
{filterOptions?.productType === "کتاب دیجیتال" && Items(0)} |
|
|
|