import { View, Text, Image, Pressable, FlatList, Platform, Linking, Dimensions, } from "react-native"; import { connect } from "react-redux"; //components import Progress from "../../../components/Progress"; //Color import Colors from "../../../constants/Colors"; import tw from "tailwind-rn"; import fontSize from "../../../constants/fontSize"; const ios = Platform.OS === "ios"; const { width, height } = Dimensions.get("window"); function MyBooks({ books, grades, theme, mobile }) { return books?.filter( (book) => (book?.productType === 2 || book?.productType === 3) && book?.condition >= 2 ).length ? ( کتابهای من book?.condition >= 2)} renderItem={({ item }) => ( )} keyExtractor={(book) => book?.id} /> ) : null; } const Book = ({ book, grades, theme, mobile }) => { const actions = { 3: () => Linking.openURL(`https://ar.dnvn.ir/lunch?id=${book?.product?.ARId}`), 2: () => Linking.openURL(`https://ar.dnvn.ir/lunch?id=${book?.product?.ARId}`), 4: () => {}, }; return ( {book?.name} {"پایه" + " " + grades[book?.product?.book?.gradeId]} ); }; const mapStateToProps = (state) => ({ grades: state.publicApi.grades, theme: state.publicApi.theme, mobile: state.publicApi.mobile, }); export default connect(mapStateToProps)(MyBooks);