diff --git a/src/components/Product/index.js b/src/components/Product/index.js index 7faed55..d906d61 100644 --- a/src/components/Product/index.js +++ b/src/components/Product/index.js @@ -41,14 +41,16 @@ const ProductDesign = ({ productImg, writeGHEIMAT, numberOfRegards, - productHolderHoverBorder + productHolderHoverBorder, + hoverMode }) => { const [isHovering, setIsHovering] = useState(false); return (
-
+
setIsHovering(true)} + onMouseLeave={() => setIsHovering(false)}>
{/* product image */}
@@ -79,8 +81,7 @@ const ProductDesign = ({ src={productImg} alt="" className="h-full rounded-lg cursor-pointer py-5" - onMouseEnter={() => setIsHovering(true)} - onMouseLeave={() => setIsHovering(false)} + /> )} {horizontalImg && ( @@ -120,13 +121,7 @@ const ProductDesign = ({
)} */} -
- {/* */} -
+
{/* product content */}
@@ -166,9 +161,8 @@ const ProductDesign = ({ >
{writeGHEIMAT && قیمت} {/* price with line on it */} @@ -185,15 +179,30 @@ const ProductDesign = ({ {/* add to cart */} {addToCartHolder && ( + )} + +
+ )} + + + + {hoverMode == 'blue' ?
+
+ +
+
: null} + {/* {productTags && (
{ @@ -208,6 +217,7 @@ const ProductDesign = ({ >
)} +
diff --git a/src/components/SalesContainer/index.js b/src/components/SalesContainer/index.js index 96c0c34..6b07dff 100644 --- a/src/components/SalesContainer/index.js +++ b/src/components/SalesContainer/index.js @@ -46,9 +46,7 @@ const SalesContainer = ({
- + { list?.map((product, index) => ( diff --git a/src/views/Home/Desktop/Part2/index.js b/src/views/Home/Desktop/Part2/index.js new file mode 100644 index 0000000..5f73120 --- /dev/null +++ b/src/views/Home/Desktop/Part2/index.js @@ -0,0 +1,85 @@ + +import React, { useState, useEffect } from "react"; +import { connect } from "react-redux"; +import { book} from '../../../../redux/actions' +import { Link } from "react-router-dom"; +import Product from '../../../../components/Product'; +import Button from "../../../../components/Button"; +import ScrollContainer from "react-indiana-drag-scroll"; + +const Part2 = ( + { books, + getBooks, + grades} +) => { + console.log({books}) + const [filter, setFilter] = useState({ + search: "", + grade: "", + productsType: "کتاب", + }); + useEffect(() => { + getBooks(); + }, []); + return ( +
+
+
+
+

+ کتاب های جدید +

+
+
+ +
+
+ + { + books?.slice(15,24).map((product, index) => ( + + + + ))} + +
+ ) +} + +const mapStateToProps = (state) => ({ + books: state.book.list, + isDark: state.publicApi.isDark, +}); +export default connect(mapStateToProps, { getBooks: book.list })(Part2); \ No newline at end of file diff --git a/src/views/Home/Desktop/index.js b/src/views/Home/Desktop/index.js index 1aa525d..c290021 100644 --- a/src/views/Home/Desktop/index.js +++ b/src/views/Home/Desktop/index.js @@ -7,6 +7,7 @@ import Banners from "../../../components/Banners"; import SalesContainer from "../../../components/SalesContainer"; import { book, publicApi } from "../../../redux/actions"; +import Part2 from "./Part2"; const DesktopHome = ( { @@ -22,6 +23,7 @@ return (
+