reza fixed home sliders

temp
Reza_ashrafi 3 years ago
parent 34cc930fb4
commit adc8846aa3
  1. 2
      src/components/Checkbox/index.js
  2. 94
      src/components/Product/index.js
  3. 2
      src/components/ProductImage/index.js
  4. 84
      src/components/SalesContainer/index.js
  5. 2
      src/components/VerticalExpandableProductFilter/index.js
  6. 2
      src/components/VodProduct/index.js
  7. 2
      src/utils/comments.js
  8. 2
      src/utils/scroll.js
  9. 2
      src/views/Auth/Profile/index.js
  10. 99
      src/views/Home/Desktop/Part2/index.js
  11. 0
      src/views/Home/Desktop/SalesContainer/index.css
  12. 78
      src/views/Home/Desktop/SalesContainer/index.js
  13. 81
      src/views/Home/Desktop/index.js
  14. 4
      src/views/QR/Content/index.js
  15. 2
      src/views/QR/Scan/index.js

@ -2,7 +2,7 @@ import React from "react";
import './index.css'; import './index.css';
export default function Checkbox(props) { export default function Checkbox(props) {
console.log(props) // console.log(props)
return ( return (
<div> <div>
<svg className="checkbox-symbol"> <svg className="checkbox-symbol">

@ -1,20 +1,22 @@
import React, { useState } from "react"; import React, { useState } from "react";
import {connect} from 'react-redux';
import StarRating from "../StarRating"; import StarRating from "../StarRating";
// import Tag from "../Tag"; // import Tag from "../Tag";
// import ReactTooltip from "react-tooltip"; // import ReactTooltip from "react-tooltip";
import book from "./goldon.png"; import book from "./goldon.png";
import watermelon from "./watermelon.png"; // import watermelon from "./watermelon.png";
import heart from "./vuesax-linear-heart.svg"; import heart from "./vuesax-linear-heart.svg";
import discountImg from "./discount.png"; import discountImg from "./discount.png";
import YellowDotIcon from "./yellowDotIcon.svg"; // import YellowDotIcon from "./yellowDotIcon.svg";
import RedDotIcon from "./redDotIcon.svg"; // import RedDotIcon from "./redDotIcon.svg";
import PurpleDotIcon from "./purpleDotIcon.svg"; // import PurpleDotIcon from "./purpleDotIcon.svg";
import LightBlueDotIcon from "./lightBlueDotIcon.svg"; // import LightBlueDotIcon from "./lightBlueDotIcon.svg";
import StarRatingComponent from "react-star-rating-component"; // import StarRatingComponent from "react-star-rating-component";
const ProductDesign = ({ const ProductDesign = ({
grades,
colors, colors,
likeBtn, likeBtn,
discount, discount,
@ -23,6 +25,7 @@ const ProductDesign = ({
productContent, productContent,
star, star,
productTags, productTags,
product,
priceDirection, priceDirection,
productTitleAlignment, productTitleAlignment,
priceHolder, priceHolder,
@ -34,28 +37,27 @@ const ProductDesign = ({
productCatTextColor, productCatTextColor,
rangeHolder, rangeHolder,
verticalImg, verticalImg,
horizontalImg,
rangeWidth, rangeWidth,
addToCartHolder, addToCartHolder,
productName, productName,
productPrice, productPrice,
productImg,
writeGHEIMAT, writeGHEIMAT,
numberOfRegards, numberOfRegards,
productHolderHoverBorder, productHolderHoverBorder,
hoverMode, hoverMode,
big, starRate,
starRate
}) => { }) => {
const [isHovering, setIsHovering] = useState(false); const [isHovering, setIsHovering] = useState(false);
return ( return (
<div className={`flex flex-wrap sm:flex-nowrap justify-around ${big ? 'm' : 'w-48 m-2'} `} <div
style={big ? {width: '300px'} : {}} className={`flex flex-wrap sm:flex-nowrap justify-around`}
style={{ direction : 'rtl' }}
> >
<div className="w-full flex flex-wrap items-center justify-around my-5 px-4" > <div className="w-full flex flex-wrap items-center justify-around my-5 px-4">
<div <div
className={`w-full sm:w-60 md:w-72 ${big ? '' : 'mx-5'} rounded-lg transition-all p-2 my-3 ${productHolderBorder} ${hoverMode == 'blue' ? 'hover:bg-grayF4' : null} ${productHolderBorderColor} hover:${productHolderHoverBorder} hover:` } className={`w-full sm:w-60 md:w-72 rounded-lg transition-all p-2 my-3 ${productHolderBorder} ${
hoverMode == "blue" ? "hover:bg-grayF4" : null
} ${productHolderBorderColor} hover:${productHolderHoverBorder} hover:`}
onMouseEnter={() => setIsHovering(true)} onMouseEnter={() => setIsHovering(true)}
onMouseLeave={() => setIsHovering(false)} onMouseLeave={() => setIsHovering(false)}
> >
@ -82,18 +84,17 @@ const ProductDesign = ({
)} )}
</div> </div>
{/* img */} {/* img */}
<div className={`w-full ${big ? 'h-60' : 'h-48'} flex bg-grayF4 p-0 justify-center rounded-lg`}> <div
className={`w-full flex bg-grayF4 p-0 justify-center rounded-lg`}
>
{verticalImg && ( {verticalImg && (
<img <img
src={productImg} src={`https://dnvn.ir/api/v1/file/${product.fileIds}`}
alt="" alt=""
className="h-full rounded-lg cursor-pointer py-5" className="rounded-lg cursor-pointer py-5"
style={{height : 'calc(100vw / 5.1)', width : 'calc(100% - 75px)'}}
/> />
)} )}
{horizontalImg && (
<img src={watermelon} alt="" className="w-full rounded-lg" />
)}
</div> </div>
{/* select Color */} {/* select Color */}
{/* {colors && ( {/* {colors && (
@ -128,7 +129,6 @@ const ProductDesign = ({
<ReactTooltip place="top" type="dark" effect="float" /> <ReactTooltip place="top" type="dark" effect="float" />
</div> </div>
)} */} )} */}
</div> </div>
{/* product content */} {/* product content */}
<div className="px-2"> <div className="px-2">
@ -136,7 +136,7 @@ const ProductDesign = ({
<h2 <h2
className={`leading-4 text-xl font-black py-2 ${productTitleColor} ${productTitleAlignment}`} className={`leading-4 text-xl font-black py-2 ${productTitleColor} ${productTitleAlignment}`}
> >
{productName} {product?.product[1]?.name}
</h2> </h2>
{productContent && ( {productContent && (
<p <p
@ -147,15 +147,17 @@ const ProductDesign = ({
</p> </p>
)} )}
{productCat && ( {productCat && (
<span className={`text-md py-1 font-light ${productCatTextColor}`}> <span
{productCat} className={`text-md py-1 font-light ${productCatTextColor}`}
>
{grades[product.gradeId]}
</span> </span>
)} )}
</div> </div>
{/* star */} {/* star */}
{star && ( {star && (
<div className="flex items-center mt-3"> <div className="flex items-center mt-3">
<StarRating value={starRate} size={big ? '' : 'small'}/> <StarRating value={starRate} />
<span className="text-xs text-productContent font-bold text-gray-500 mr-2"> <span className="text-xs text-productContent font-bold text-gray-500 mr-2">
بر اساس {numberOfRegards} بررسی بر اساس {numberOfRegards} بررسی
</span> </span>
@ -168,10 +170,15 @@ const ProductDesign = ({
> >
<div className="mt-2"> <div className="mt-2">
<div <div
className={`${priceDirection.indexOf("col") !== -1 ? "inline" : "flex" className={`${
priceDirection.indexOf("col") !== -1 ? "inline" : "flex"
}`} }`}
> >
{writeGHEIMAT && <span className="text-xs text-borderColor ml-2">قیمت</span>} {writeGHEIMAT && (
<span className="text-xs text-borderColor ml-2">
قیمت
</span>
)}
{/* price with line on it */} {/* price with line on it */}
{discountPrice && ( {discountPrice && (
<p className="line-through text-xs text-borderColor mr-2"> <p className="line-through text-xs text-borderColor mr-2">
@ -180,35 +187,33 @@ const ProductDesign = ({
)} )}
</div> </div>
<p className="text-xl text-productPrice font-semibold inline text-blue5F"> <p className="text-xl text-productPrice font-semibold inline text-blue5F">
{productPrice} <span>تومان</span> {product?.product[1]?.price} <span>تومان</span>
</p> </p>
</div> </div>
{/* add to cart */} {/* add to cart */}
{addToCartHolder && ( {addToCartHolder && (
<button <button
className={`rounded-2xl px-2 py-3 border text-xs text-productPrice mt-2 hover:bg-darkCrimsonBgColor hover:text-white active:bg-rangeFillBgColor transition duration-500 hover:-translate-y-2 ${priceDirection.indexOf("col") !== -1 ? "w-full" : "" className={`rounded-2xl px-2 py-3 border text-xs text-productPrice mt-2 hover:bg-darkCrimsonBgColor hover:text-white active:bg-rangeFillBgColor transition duration-500 hover:-translate-y-2 ${
priceDirection.indexOf("col") !== -1 ? "w-full" : ""
}`} }`}
> >
اضافه کردن به سبد خرید اضافه کردن به سبد خرید
</button> </button>
)} )}
</div> </div>
)} )}
{hoverMode == "blue" ? (
<div className="w-full flex justify-center mt-4">
{hoverMode == 'blue' ?<div className="w-full flex justify-center mt-4">
<div <div
className={`bg-blueC0 text-white rounded p-4 text-xs justify-center ${isHovering ? "" : "hidden" className={`bg-blueC0 text-white rounded p-4 text-xs justify-center ${
isHovering ? "" : "hidden"
}`} }`}
> >
<button>افزودن به سبد خرید</button> <button>افزودن به سبد خرید</button>
</div> </div>
</div> : null} </div>
) : null}
{/* {productTags && ( {/* {productTags && (
<div className="mt-2 flex flex-wrap"> <div className="mt-2 flex flex-wrap">
@ -224,7 +229,6 @@ const ProductDesign = ({
></div> ></div>
</div> </div>
)} )}
</div> </div>
</div> </div>
</div> </div>
@ -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 colors i used for product title:
// text-darkCrimsonTextColor // text-darkCrimsonTextColor
@ -281,5 +289,5 @@ ProductDesign.defaultProps = {
//میتونیم تعیین کنیم که قیمت و دکمه اضاف به سبد خرید کنار یکدیگر باشند یا زیر هم //میتونیم تعیین کنیم که قیمت و دکمه اضاف به سبد خرید کنار یکدیگر باشند یا زیر هم
priceDirection: "flex-row", priceDirection: "flex-row",
productImg: book, productImg: book,
writeGHEIMAT: false writeGHEIMAT: false,
}; };

@ -5,7 +5,7 @@ import "./index.scss";
import productImg from "./product-image.jpg"; import productImg from "./product-image.jpg";
const ProductImage = ({ images }) => { const ProductImage = ({ images }) => {
console.log(images.length); // console.log(images.length);
return ( return (
<div className="flex flex-row w-1/3 gap-2"> <div className="flex flex-row w-1/3 gap-2">

@ -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(
<div className="w-full my-10">
<div className="w-full border-b-2 border-solid border-blue-300 mb-24" style={{height: '100px'}}>
<div className="w-1/3 p-10 bg-white flex justify-between items-center" style={{
marginBottom:'-5px',
height:'200px'
}} onClick={() => console.log(list)}>
<div className="flex items-center ">
{/* <div className="w-6 h-6 bg-blue-300 ml-4 rounded-full"></div> */}
<h1 className="text-3xl leading-normal">
<h3 className=" bg-blueC0 text-white text-center"> دوشنبه </h3>
<h3 className="mr-4 w-24 text-center" style={{background: '#EFFF00'}}> کتاااابی </h3>
</h1>
</div>
<div className="flex items-center">
<p className="text-md">بیش از ۵۰ کتاب تخفیف خورده</p>
<div className="w-6 h-6 bg-blue-300 mr-4 rounded-full">
</div>
</div>
</div>
</div>
<ScrollContainer className="flex overflow-x-scroll border-t-0 py-4 pl-10" style={{height:'550px'}} >
{
list?.map((product, index) => (
<Link to={"/products/" + product?.id}>
<Product
key={`prod_takhfif${index}`}
productsType={filter.productsType}
product={product}
index={Number(index)}
productName={`کتاب ${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={100000}
productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productTitleColor='text-blue5F'
productCatTextColor='text-blueC0'
productHolderBorder=''
productHolderHoverBorder='shadow-md'
big
starRate={Math.floor(Math.random() * 5) + 1}
discountPricePercent
hoverMode='blue'
/>
</Link>
))}
</ScrollContainer>
</div>
)
}
const mapStateToProps = (state) => ({
list: state.book.list,
isDark: state.publicApi.isDark,
});
export default connect(mapStateToProps, { getList: book.list })(SalesContainer);

@ -61,7 +61,7 @@ export default function VerticalExpandableProductFilter(props) {
key={i} key={i}
className="hover:bg-gray-100 px-3 flex flex-row items-center justify-between py-2" className="hover:bg-gray-100 px-3 flex flex-row items-center justify-between py-2"
> >
{console.log(i)} {/* {console.log(i)} */}
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
<Checkbox name={`ch${name}_${i}`} checked={checkedBox[i]} onclick={(e) => { <Checkbox name={`ch${name}_${i}`} checked={checkedBox[i]} onclick={(e) => {
checkedBox[i] = !checkedBox[i] checkedBox[i] = !checkedBox[i]

@ -60,7 +60,7 @@ const VodProduct = ({
}, 1000); }, 1000);
}); });
console.log(index); // console.log(index);
return ( return (
<> <>
{/* product UI Design */} {/* product UI Design */}

@ -18,5 +18,5 @@ export const connectToParent = (list) => {
} }
} }
// comments = comments.filter((comment) => comment.pid === null); // comments = comments.filter((comment) => comment.pid === null);
console.log(comments); // console.log(comments);
}; };

@ -157,7 +157,7 @@ class scroll {
initializeBoxPosition = (currentScroll) => { initializeBoxPosition = (currentScroll) => {
const height= window.innerHeight; const height= window.innerHeight;
if(currentScroll < height){ if(currentScroll < height){
console.log(currentScroll); // console.log(currentScroll);
return { return {
translateX: -5, translateX: -5,
translateY: -5, translateY: -5,

@ -336,7 +336,7 @@ function Profile({
/> />
</div> </div>
) : null} ) : null}
{console.log(province)} {/* {console.log(province)} */}
<div className="mb-2" style={{ minWidth: "100%" }}> <div className="mb-2" style={{ minWidth: "100%" }}>
<Select <Select
options={provinceList} options={provinceList}

@ -1,39 +1,36 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { book} from '../../../../redux/actions' import { book } from "../../../../redux/actions";
import { Carousel } from "@trendyol-js/react-carousel";
import arrow from "../../../../assets/icons/slider-arrow.svg";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import Product from '../../../../components/Product'; import Product from "../../../../components/Product";
import Button from "../../../../components/Button"; import Button from "../../../../components/Button";
import ScrollContainer from "react-indiana-drag-scroll"; // import ScrollContainer from "react-indiana-drag-scroll";
const Part2 = ( const Part2 = ({ books, grades }) => {
{ books, // console.log({ books });
getBooks,
grades}
) => {
console.log({books})
const [filter, setFilter] = useState({ const [filter, setFilter] = useState({
search: "", search: "",
grade: "", grade: "",
productsType: "کتاب", productsType: "کتاب",
}); });
useEffect(() => {
getBooks();
}, []);
return ( return (
<div className="w-full my-6" style={{ <div
height: '550px' className="w-full my-6"
}}> style={
<div className="w-full flex justify-between items-center pr-10"> {
// height: "550px",
}
}
>
<div className="w-full flex justify-between items-center">
<div className="flex items-center text-4xl font-black text-blue52"> <div className="flex items-center text-4xl font-black text-blue52">
<div className="w-6 h-6 bg-blue-300 ml-4 rounded-full"></div> <div className="w-6 h-6 bg-blue-300 ml-4 rounded-full"></div>
<h1> <h1>کتاب های جدید</h1>
کتاب های جدید
</h1>
</div> </div>
<div> <div>
<Link to='/products'> <Link to="/products">
<Button <Button
title="مشاهده لیست محصولات" title="مشاهده لیست محصولات"
backgroundColor="bg-blue-100" backgroundColor="bg-blue-100"
@ -43,8 +40,7 @@ const Part2 = (
}} }}
width="100%" width="100%"
selectable={true} selectable={true}
color="text-blueC0"
color= "text-blueC0"
onClick={() => null} onClick={() => null}
radius={false} radius={false}
twPaddings="py-4 px-12 rounded" twPaddings="py-4 px-12 rounded"
@ -52,37 +48,40 @@ const Part2 = (
</Link> </Link>
</div> </div>
</div> </div>
<ScrollContainer className="flex overflow-x-scroll py-4 pl-10"> {books.length > 0 && (
{ <div className="relative w-full" style={{ direction: "ltr" }}>
books?.slice(15,24).map((product, index) => ( <Carousel
<Link to={"/products/" + product?.id}> show={4.5}
<Product slide={2}
key={`prod_New${index}`} swiping={true}
productsType={filter.productsType} useArrowKeys={true}
product={product} transition={0.5}
index={Number(index)} rightArrow={
productName={`کتاب ${product?.name}`} <img
productCat={`پایه ${grades[product?.gradeId]}`} className="absolute top-1/2 transform -translate-y-1/2 cursor-pointer p-5"
productPrice={100000} src={arrow}
productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds} alt=""
numberOfRegards={160}
productTitleColor='text-blue5F'
productCatTextColor='text-blueC0'
productHolderBorder=''
productHolderHoverBorder='shadow-md'
hoverMode='blue'
big
starRate={Math.floor(Math.random() * 5) + 1}
/> />
</Link> }
leftArrow={
<img
className="absolute top-1/2 transform -translate-y-1/2 -translate-x-5 cursor-pointer -rotate-180 p-5"
src={arrow}
alt=""
/>
}
>
{books.map((product, index) => (
<Product key={index} product={product} />
))} ))}
</ScrollContainer> </Carousel>
</div>
)}
</div> </div>
) );
} };
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
books: state.book.list,
isDark: state.publicApi.isDark, isDark: state.publicApi.isDark,
}); });
export default connect(mapStateToProps, { getBooks: book.list })(Part2); export default connect(mapStateToProps, {})(Part2);

@ -0,0 +1,78 @@
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 { Carousel } from "@trendyol-js/react-carousel";
import arrow from "../../../../assets/icons/slider-arrow.svg";
import { Link } from "react-router-dom";
import Product from "../../../../components/Product";
import "./index.css";
const SalesContainer = ({ books }) => {
const [filter, setFilter] = useState({
search: "",
grade: "",
productsType: "کتاب",
});
return (
<div className="w-full my-10">
<div className="w-full py-10 pl-2 bg-white flex justify-between items-center gap-3">
<div className="flex flex-row items-center pl-4">
{/* <div className="w-6 h-6 bg-blue-300 ml-4 rounded-full"></div> */}
<div className="text-3xl leading-normal">
<h3 className=" bg-blueC0 text-white text-center"> دوشنبه </h3>
<h3
className="mr-4 text-center"
style={{ background: "#EFFF00" }}
>
{" "}
کتاااابی{" "}
</h3>
</div>
</div>
<div className="flex items-center">
<p className="text-md flex">بیش از ۵۰ کتاب تخفیف خورده&nbsp;</p>
<div className="w-6 h-6 bg-blue-300 mr-4 rounded-full"></div>
</div>
<span className="flex-1 h-0.5 bg-gray-200 mr-10"></span>
</div>
{books.length > 0 && (
<div className="relative w-full" style={{ direction: "ltr" }}>
<Carousel
show={window.innerWidth / 350}
slide={2}
swiping={true}
useArrowKeys={true}
transition={0.5}
rightArrow={
<img
className="absolute top-1/2 transform -translate-y-1/2 cursor-pointer p-5"
src={arrow}
alt=""
// onClick={(e) => e.stopPropagation()}
/>
}
leftArrow={
<img
className="absolute top-1/2 transform -translate-y-1/2 -translate-x-5 cursor-pointer -rotate-180 p-5"
src={arrow}
alt=""
// onClick={(e) => e.stopPropagation()}
/>
}
>
{books.map((product, index) => (
<Product key={index} product={product} />
))}
</Carousel>
</div>
)}
</div>
);
};
const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark,
});
export default connect(mapStateToProps, { getList: book.list })(SalesContainer);

@ -1,56 +1,65 @@
import React, { useState, useEffect, useCallback } from "react"; import React, { useState, useEffect } from "react";
import ScrollContainer from "react-indiana-drag-scroll"; import { connect } from "react-redux";
import { connect } from 'react-redux';
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import filterIcon from '../../../assets/images/vuesax-linear-filter-tick.svg'; import filterIcon from "../../../assets/images/vuesax-linear-filter-tick.svg";
import Banners from "../../../components/Banners"; import Banners from "../../../components/Banners";
import SalesContainer from "../../../components/SalesContainer"; import SalesContainer from "./SalesContainer";
import { book, publicApi } from "../../../redux/actions"; import { book, publicApi } from "../../../redux/actions";
import Part2 from "./Part2"; import Part2 from "./Part2";
import HomeImg from '../../../assets/images/HomeImg.png'; import HomeImg from "../../../assets/images/HomeImg.png";
import Part4 from "./Part4"; import Part4 from "./Part4";
import Design2D from "../../../components/Design2D"; import Design2D from "../../../components/Design2D";
import { get } from "lodash";
const DesktopHome = ( const DesktopHome = ({ grades, getList, books }) => {
{ const banners = [
books,
grades
}
) =>{
const banners = [
{ {
flex: 4, flex: 4,
items: [{ bg:'', items: [
{
bg: "",
flex: 1, flex: 1,
image: 'https://dkstatics-public.digikala.com/digikala-adservice-banners/d2a56a4a0c3ce4645bf0b405b0bbf3a29da1cbd3_1642861192.jpg' image:
}], "https://dkstatics-public.digikala.com/digikala-adservice-banners/d2a56a4a0c3ce4645bf0b405b0bbf3a29da1cbd3_1642861192.jpg",
},
],
}, },
{ {
flex: 2, flex: 2,
items: [ items: [
{ bg:'', {
bg: "",
flex: 1, flex: 1,
image: 'https://dkstatics-public.digikala.com/digikala-adservice-banners/e13aefeda2d3b44db78a92aac9cdc82a9b1650e9_1632230372.jpg?' image:
"https://dkstatics-public.digikala.com/digikala-adservice-banners/e13aefeda2d3b44db78a92aac9cdc82a9b1650e9_1632230372.jpg?",
}, },
{ bg:'', {
bg: "",
flex: 1, flex: 1,
image: 'https://dkstatics-public.digikala.com/digikala-adservice-banners/fe8f275f4e4b5e6eb2f66cf65f3895398e049b40_1625578273.jpg' image:
"https://dkstatics-public.digikala.com/digikala-adservice-banners/fe8f275f4e4b5e6eb2f66cf65f3895398e049b40_1625578273.jpg",
}, },
], ],
}, },
{ {
flex: 2, flex: 2,
items: [{ bg:'', items: [
{
bg: "",
flex: 1, flex: 1,
image: 'https://dkstatics-public.digikala.com/digikala-adservice-banners/54d75e08cb0a72920ac3b2338232bf5ca70ccc74_1641638418.jpg' image:
}], "https://dkstatics-public.digikala.com/digikala-adservice-banners/54d75e08cb0a72920ac3b2338232bf5ca70ccc74_1641638418.jpg",
},
],
}, },
] ];
return ( useEffect(() => {
getList();
},[]);
return (
<div className="flex flex-col items-center w-11/12 justify-center my-10"> <div className="flex flex-col items-center w-11/12 justify-center my-10">
{/* <Banners {/* <Banners
mainBanner='https://dkstatics-public.digikala.com/digikala-adservice-banners/d2a56a4a0c3ce4645bf0b405b0bbf3a29da1cbd3_1642861192.jpg' mainBanner='https://dkstatics-public.digikala.com/digikala-adservice-banners/d2a56a4a0c3ce4645bf0b405b0bbf3a29da1cbd3_1642861192.jpg'
@ -61,32 +70,28 @@ return (
<div className="w-full"> <div className="w-full">
<Design2D array={banners} /> <Design2D array={banners} />
</div> </div>
<SalesContainer books={books} grades={grades}/> <SalesContainer books={books} />
<Part2 grades={grades}/> <Part2 grades={grades} books={books} />
<div className="mb-16"> <div className="mb-16">
<img src={HomeImg} /> <img src={HomeImg} />
</div> </div>
<Part4 /> <Part4 />
</div> </div>
);
) };
}
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark, isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile, isMobile: state.publicApi.isMobile,
books: state.book.list, books: state.book.list,
grades: state.publicApi.grades,
gradeFilterBooks: state.book.gradeFilterBooks, gradeFilterBooks: state.book.gradeFilterBooks,
selectedGrade: state.book.selectedGrade, selectedGrade: state.book.selectedGrade,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
getList: book.list, getList: book.list,
gradeFilter: book.gradeFilter, gradeFilter: book.gradeFilter,
setHeaderOptions: publicApi.setHeaderOptions, setHeaderOptions: publicApi.setHeaderOptions,
}; };
export default connect(mapStateToProps, mapDispatchToProps)(DesktopHome);
export default connect(mapStateToProps, mapDispatchToProps)(DesktopHome);

@ -12,14 +12,14 @@ export const Content = ({
}) => { }) => {
useEffect(() => { useEffect(() => {
const path = window.location.pathname; const path = window.location.pathname;
console.log(path.slice(path.lastIndexOf("/") + 1, path.length)); // console.log(path.slice(path.lastIndexOf("/") + 1, path.length));
setHeaderOptions(headerOptions); setHeaderOptions(headerOptions);
getQrData({ tail: path.slice(path.lastIndexOf("/") + 1, path.length) }); getQrData({ tail: path.slice(path.lastIndexOf("/") + 1, path.length) });
}, []); }, []);
useEffect(() => { useEffect(() => {
if (data) { if (data) {
console.log(data?.book?.name); // console.log(data?.book?.name);
} }
}, [data]); }, [data]);

@ -18,7 +18,7 @@ export const Scan = ({
}; };
const handleError = (err) => { const handleError = (err) => {
console.error(err); // console.error(err);
}; };
useEffect(() => { useEffect(() => {

Loading…
Cancel
Save