|
|
|
@ -17,7 +17,14 @@ import Main from "./components/Main"; |
|
|
|
|
|
|
|
|
|
//style
|
|
|
|
|
|
|
|
|
|
function Products({ books, getBooks, grades }) { |
|
|
|
|
function Products({ |
|
|
|
|
books, |
|
|
|
|
getBooks, |
|
|
|
|
grades, |
|
|
|
|
route, |
|
|
|
|
setFilterOptions, |
|
|
|
|
filterOptions, |
|
|
|
|
}) { |
|
|
|
|
const [position, setPosition] = useState("100%"); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
@ -29,6 +36,12 @@ function Products({ books, getBooks, grades }) { |
|
|
|
|
setPosition(position === "100%" ? "0%" : "100%"); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (route?.params?.productType === "دوره ویدئویی") { |
|
|
|
|
setFilterOptions({ ...filterOptions, productType: "دوره ویدئویی" }); |
|
|
|
|
} |
|
|
|
|
}, [route]); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<SafeAreaView |
|
|
|
|
style={{ |
|
|
|
@ -49,6 +62,7 @@ function Products({ books, getBooks, grades }) { |
|
|
|
|
const mapStateToProps = (state) => ({ |
|
|
|
|
grades: state.publicApi.grades, |
|
|
|
|
books: state.book.list, |
|
|
|
|
filterOptions: state.book.filterOptions, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = { |
|
|
|
|