From adc8846aa3c9fd2839b616acace4e1c883d3b373 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Wed, 2 Feb 2022 23:02:57 +0330 Subject: [PATCH] reza fixed home sliders --- src/components/Checkbox/index.js | 2 +- src/components/Product/index.js | 104 ++++++------ src/components/ProductImage/index.js | 2 +- src/components/SalesContainer/index.js | 84 ---------- .../VerticalExpandableProductFilter/index.js | 2 +- src/components/VodProduct/index.js | 2 +- src/utils/comments.js | 2 +- src/utils/scroll.js | 2 +- src/views/Auth/Profile/index.js | 2 +- src/views/Home/Desktop/Part2/index.js | 153 +++++++++--------- .../Home/Desktop}/SalesContainer/index.css | 0 .../Home/Desktop/SalesContainer/index.js | 78 +++++++++ src/views/Home/Desktop/index.js | 151 ++++++++--------- src/views/QR/Content/index.js | 4 +- src/views/QR/Scan/index.js | 2 +- 15 files changed, 298 insertions(+), 292 deletions(-) delete mode 100644 src/components/SalesContainer/index.js rename src/{components => views/Home/Desktop}/SalesContainer/index.css (100%) create mode 100644 src/views/Home/Desktop/SalesContainer/index.js diff --git a/src/components/Checkbox/index.js b/src/components/Checkbox/index.js index 38d5dd1..f9d4f26 100644 --- a/src/components/Checkbox/index.js +++ b/src/components/Checkbox/index.js @@ -2,7 +2,7 @@ import React from "react"; import './index.css'; export default function Checkbox(props) { - console.log(props) + // console.log(props) return (
diff --git a/src/components/Product/index.js b/src/components/Product/index.js index 24fbab1..e7c5be7 100644 --- a/src/components/Product/index.js +++ b/src/components/Product/index.js @@ -1,20 +1,22 @@ import React, { useState } from "react"; +import {connect} from 'react-redux'; import StarRating from "../StarRating"; // import Tag from "../Tag"; // import ReactTooltip from "react-tooltip"; import book from "./goldon.png"; -import watermelon from "./watermelon.png"; +// import watermelon from "./watermelon.png"; import heart from "./vuesax-linear-heart.svg"; import discountImg from "./discount.png"; -import YellowDotIcon from "./yellowDotIcon.svg"; -import RedDotIcon from "./redDotIcon.svg"; -import PurpleDotIcon from "./purpleDotIcon.svg"; -import LightBlueDotIcon from "./lightBlueDotIcon.svg"; -import StarRatingComponent from "react-star-rating-component"; +// import YellowDotIcon from "./yellowDotIcon.svg"; +// import RedDotIcon from "./redDotIcon.svg"; +// import PurpleDotIcon from "./purpleDotIcon.svg"; +// import LightBlueDotIcon from "./lightBlueDotIcon.svg"; +// import StarRatingComponent from "react-star-rating-component"; const ProductDesign = ({ + grades, colors, likeBtn, discount, @@ -23,6 +25,7 @@ const ProductDesign = ({ productContent, star, productTags, + product, priceDirection, productTitleAlignment, priceHolder, @@ -34,28 +37,27 @@ const ProductDesign = ({ productCatTextColor, rangeHolder, verticalImg, - horizontalImg, rangeWidth, addToCartHolder, productName, productPrice, - productImg, writeGHEIMAT, numberOfRegards, productHolderHoverBorder, hoverMode, - big, - starRate + starRate, }) => { const [isHovering, setIsHovering] = useState(false); return ( -
-
+
setIsHovering(true)} onMouseLeave={() => setIsHovering(false)} > @@ -82,18 +84,17 @@ const ProductDesign = ({ )}
{/* img */} -
+
{verticalImg && ( )} - {horizontalImg && ( - - )}
{/* select Color */} {/* {colors && ( @@ -128,7 +129,6 @@ const ProductDesign = ({
)} */} -
{/* product content */}
@@ -136,7 +136,7 @@ const ProductDesign = ({

- {productName} + {product?.product[1]?.name}

{productContent && (

)} {productCat && ( - - {productCat} + + {grades[product.gradeId]} )}

{/* star */} {star && (
- + بر اساس {numberOfRegards} بررسی @@ -168,10 +170,15 @@ const ProductDesign = ({ >
- {writeGHEIMAT && قیمت} + {writeGHEIMAT && ( + + قیمت + + )} {/* price with line on it */} {discountPrice && (

@@ -180,35 +187,33 @@ const ProductDesign = ({ )}

- {productPrice} تومان + {product?.product[1]?.price} تومان

{/* add to cart */} {addToCartHolder && ( - )} - -
- )} - - - {hoverMode == 'blue' ?
-
+
- + > + +
-
: null} + ) : null} {/* {productTags && (
@@ -224,7 +229,6 @@ const ProductDesign = ({ >
)} -
@@ -232,7 +236,11 @@ const ProductDesign = ({ ); }; -export default ProductDesign; +const mapStateToProps = (state) => ({ + grades : state.publicApi.grades, +}) + +export default connect(mapStateToProps)(ProductDesign); // text colors i used for product title: // text-darkCrimsonTextColor @@ -281,5 +289,5 @@ ProductDesign.defaultProps = { //میتونیم تعیین کنیم که قیمت و دکمه اضاف به سبد خرید کنار یکدیگر باشند یا زیر هم priceDirection: "flex-row", productImg: book, - writeGHEIMAT: false + writeGHEIMAT: false, }; diff --git a/src/components/ProductImage/index.js b/src/components/ProductImage/index.js index 62a52c9..25fa0c6 100644 --- a/src/components/ProductImage/index.js +++ b/src/components/ProductImage/index.js @@ -5,7 +5,7 @@ import "./index.scss"; import productImg from "./product-image.jpg"; const ProductImage = ({ images }) => { - console.log(images.length); + // console.log(images.length); return (
diff --git a/src/components/SalesContainer/index.js b/src/components/SalesContainer/index.js deleted file mode 100644 index 1043327..0000000 --- a/src/components/SalesContainer/index.js +++ /dev/null @@ -1,84 +0,0 @@ -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/components/VerticalExpandableProductFilter/index.js b/src/components/VerticalExpandableProductFilter/index.js index 7f583a8..82d779d 100644 --- a/src/components/VerticalExpandableProductFilter/index.js +++ b/src/components/VerticalExpandableProductFilter/index.js @@ -61,7 +61,7 @@ export default function VerticalExpandableProductFilter(props) { key={i} className="hover:bg-gray-100 px-3 flex flex-row items-center justify-between py-2" > - {console.log(i)} + {/* {console.log(i)} */}
{ checkedBox[i] = !checkedBox[i] diff --git a/src/components/VodProduct/index.js b/src/components/VodProduct/index.js index 363833f..c3f1ded 100644 --- a/src/components/VodProduct/index.js +++ b/src/components/VodProduct/index.js @@ -60,7 +60,7 @@ const VodProduct = ({ }, 1000); }); - console.log(index); + // console.log(index); return ( <> {/* product UI Design */} diff --git a/src/utils/comments.js b/src/utils/comments.js index 5b6cfd8..a3fd1dc 100644 --- a/src/utils/comments.js +++ b/src/utils/comments.js @@ -18,5 +18,5 @@ export const connectToParent = (list) => { } } // comments = comments.filter((comment) => comment.pid === null); - console.log(comments); + // console.log(comments); }; diff --git a/src/utils/scroll.js b/src/utils/scroll.js index 61b1486..c665e9b 100644 --- a/src/utils/scroll.js +++ b/src/utils/scroll.js @@ -157,7 +157,7 @@ class scroll { initializeBoxPosition = (currentScroll) => { const height= window.innerHeight; if(currentScroll < height){ - console.log(currentScroll); + // console.log(currentScroll); return { translateX: -5, translateY: -5, diff --git a/src/views/Auth/Profile/index.js b/src/views/Auth/Profile/index.js index 9b8ecf0..5123ebb 100644 --- a/src/views/Auth/Profile/index.js +++ b/src/views/Auth/Profile/index.js @@ -336,7 +336,7 @@ function Profile({ />
) : null} - {console.log(province)} + {/* {console.log(province)} */}