diff --git a/src/components/Navbar/index.js b/src/components/Navbar/index.js
index f15fe2e..b8af9bf 100644
--- a/src/components/Navbar/index.js
+++ b/src/components/Navbar/index.js
@@ -64,6 +64,8 @@ function Navbar({
useEffect(() => {
if (!isMobile && isLogin) {
console.log(111);
+ // console.log/("gl3");
+
getCartProducts();
}
}, [isLogin]);
diff --git a/src/components/StarRating/index.js b/src/components/StarRating/index.js
index 1b04634..b50ffee 100644
--- a/src/components/StarRating/index.js
+++ b/src/components/StarRating/index.js
@@ -19,7 +19,8 @@ function StarRating({
const [rate, setRating] = React.useState(null);
useMemo(() => {
- if (isLogin) getUserProducts();
+ //console.log("gl2");
+ // if (isLogin && !userProducts.length) getUserProducts();
}, []);
React.useEffect(() => {
diff --git a/src/views/Products/layouts/Desktop/Main.js b/src/views/Products/layouts/Desktop/Main.js
index 3e38572..3ae9a3a 100644
--- a/src/views/Products/layouts/Desktop/Main.js
+++ b/src/views/Products/layouts/Desktop/Main.js
@@ -14,7 +14,7 @@ import moment from "jalali-moment";
import dropdownIcon from "../../../../assets/icons/dropdown-blue.svg";
import Posts from "./Posts";
import Pagination from "./Pagination";
-
+const num = 6;
export const Main = ({
books,
grades,
@@ -24,17 +24,23 @@ export const Main = ({
isMobile,
}) => {
const [filterLoading, setFilterLoading] = useState(false);
+ const [page, setPage] = useState(1);
+ const [total, setTotal] = useState(books.length);
useEffect(() => {
- setFilterLoading(() => true);
- setTimeout(() => {
- setFilterLoading(() => false);
- }, 500);
+ // setFilterLoading(() => true);
+ // setTimeout(() => {
+ // setFilterLoading(() => false);
+ // }, 500);
+ setPage(1);
}, [filterOptions]);
useEffect(() => {
window.scrollTo(0, 0);
}, []);
+ useEffect(() => {
+ setTotal(books.length);
+ }, [books]);
const Items = (type) => {
const { grade, subject, available, sort, productType } = filterOptions;
@@ -82,83 +88,22 @@ export const Main = ({
} else {
bySortFilter = byAvailableFilter;
}
- return type === 2
- ? bySortFilter?.map((item, index) => (
-