From 0cd9175a836c3ecc21a614b0b90a739b45ac1480 Mon Sep 17 00:00:00 2001 From: Pkpedram Date: Sat, 29 Jan 2022 16:26:53 +0330 Subject: [PATCH] Home Page Desktop Sales Container Made --- src/components/SalesContainer/index.css | 0 src/components/SalesContainer/index.js | 81 +++++++++++++++++++++++++ src/views/Home/Desktop/index.js | 14 +++-- 3 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 src/components/SalesContainer/index.css create mode 100644 src/components/SalesContainer/index.js diff --git a/src/components/SalesContainer/index.css b/src/components/SalesContainer/index.css new file mode 100644 index 0000000..e69de29 diff --git a/src/components/SalesContainer/index.js b/src/components/SalesContainer/index.js new file mode 100644 index 0000000..96c0c34 --- /dev/null +++ b/src/components/SalesContainer/index.js @@ -0,0 +1,81 @@ +import React, {useState, useEffect} from "react"; +import { connect } from "react-redux"; +import { book, publicApi } from "../../redux/actions"; +import ScrollContainer from "react-indiana-drag-scroll"; +import { Link } from "react-router-dom"; +import Product from "../Product"; +import './index.css'; + +const SalesContainer = ({ + list, getList, + grades +}) =>{ + const [filter, setFilter] = useState({ + search: "", + grade: "", + productsType: "کتاب", + }); + useEffect(() => { + getList(); + }, []); + return( +
+
+
console.log(list)}> + +
+
+

+ +

دوشنبه

+

کتاااابی

+ + + +
+
+

بیش از ۵۰ کتاب تخفیف خورده

+
+ +
+ +
+ +
+ +
+ + { + list?.map((product, index) => ( + + + + ))} + +
+ ) +} + + const mapStateToProps = (state) => ({ + list: state.book.list, + isDark: state.publicApi.isDark, + }); + export default connect(mapStateToProps, { getList: book.list })(SalesContainer); \ No newline at end of file diff --git a/src/views/Home/Desktop/index.js b/src/views/Home/Desktop/index.js index 502302c..1aa525d 100644 --- a/src/views/Home/Desktop/index.js +++ b/src/views/Home/Desktop/index.js @@ -4,21 +4,25 @@ import { connect } from 'react-redux'; import { Link } from "react-router-dom"; import filterIcon from '../../../assets/images/vuesax-linear-filter-tick.svg'; import Banners from "../../../components/Banners"; +import SalesContainer from "../../../components/SalesContainer"; import { book, publicApi } from "../../../redux/actions"; const DesktopHome = ( - +{ + books, + grades +} ) =>{ return ( -
- +
+ + +
)