|
|
@ -1,32 +1,42 @@ |
|
|
|
import React, { useState } from "react"; |
|
|
|
import React, { useState } from "react"; |
|
|
|
|
|
|
|
|
|
|
|
import TagDesign1 from "../../Tag/TagDesign1"; |
|
|
|
import TagDesign1 from "../../Tag/TagDesign1"; |
|
|
|
import ButtonDivTag from "../../ButtonDesign/ButtonDivTag"; |
|
|
|
import ButtonDivTag from "../../ButtonDesign/ButtonDivTag"; |
|
|
|
import Button from "../../ButtonDesign/Button"; |
|
|
|
import Button from "../../ButtonDesign/Button"; |
|
|
|
import StarRating from "../../Rating/StarRating1"; |
|
|
|
import StarRating from "../../Rating/StarRating1"; |
|
|
|
import Tooptip1 from "../../Tooltip/Tooltip1"; |
|
|
|
import Tooptip1 from "../../Tooltip/Tooltip1"; |
|
|
|
|
|
|
|
import AnimatedProgressbar1 from "../../ProgressBar/AnimatedProgressbar1"; |
|
|
|
|
|
|
|
|
|
|
|
const Design1 = ({ |
|
|
|
const Design1 = ({ |
|
|
|
productHolderClassname, |
|
|
|
productHolderClassname, |
|
|
|
|
|
|
|
|
|
|
|
discountPricePercent, |
|
|
|
discountPricePercent, |
|
|
|
likeBtn, |
|
|
|
likeBtn, |
|
|
|
discount, |
|
|
|
discount, |
|
|
|
|
|
|
|
|
|
|
|
colors, |
|
|
|
verticalImg, |
|
|
|
discountPrice, |
|
|
|
horizontalImg, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tooltip, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
productTitle, |
|
|
|
|
|
|
|
productTitleClass, |
|
|
|
|
|
|
|
|
|
|
|
productContent, |
|
|
|
productContent, |
|
|
|
|
|
|
|
productContentClass, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
productCat, |
|
|
|
|
|
|
|
|
|
|
|
star, |
|
|
|
star, |
|
|
|
productTags, |
|
|
|
|
|
|
|
|
|
|
|
discountPrice, |
|
|
|
|
|
|
|
price, |
|
|
|
|
|
|
|
progressBar, |
|
|
|
|
|
|
|
|
|
|
|
priceDirection, |
|
|
|
priceDirection, |
|
|
|
productTitleAlignment, |
|
|
|
|
|
|
|
|
|
|
|
productTags, |
|
|
|
priceHolder, |
|
|
|
priceHolder, |
|
|
|
productTitleColor, |
|
|
|
|
|
|
|
productExcerptTextColor, |
|
|
|
|
|
|
|
productCat, |
|
|
|
|
|
|
|
productCatTextColor, |
|
|
|
|
|
|
|
rangeHolder, |
|
|
|
|
|
|
|
verticalImg, |
|
|
|
|
|
|
|
horizontalImg, |
|
|
|
|
|
|
|
rangeWidth, |
|
|
|
|
|
|
|
addToCartHolder, |
|
|
|
addToCartHolder, |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
@ -79,91 +89,108 @@ const Design1 = ({ |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{/* select Color */} |
|
|
|
{/* select Color */} |
|
|
|
{colors && ( |
|
|
|
{tooltip && ( |
|
|
|
<div className="flex items-center gap-x-1 absolute right-2 bottom-2"> |
|
|
|
<div className="flex items-center gap-x-1 absolute right-2 bottom-2"> |
|
|
|
<Tooptip1 /> |
|
|
|
<Tooptip1 |
|
|
|
|
|
|
|
items={[ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
image: "images/SingleProductyellowDotIcon.svg", |
|
|
|
|
|
|
|
dataTip: "زرد", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
image: "images/SingleProductredDotIcon.svg", |
|
|
|
|
|
|
|
dataTip: "قرمز", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
image: "images/SingleProductpurpleDotIcon.svg", |
|
|
|
|
|
|
|
dataTip: "بنفش", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
image: "images/SingleProductlightBlueDotIcon.svg", |
|
|
|
|
|
|
|
dataTip: "آبی", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{/* product content */} |
|
|
|
{/* product content */} |
|
|
|
<div className="px-2"> |
|
|
|
<div className="p-2 my-4"> |
|
|
|
<div className="mt-4"> |
|
|
|
{/* productTitle */} |
|
|
|
<h2 |
|
|
|
<h2 className={`${productTitleClass}`}>{productTitle}</h2>{" "} |
|
|
|
className={`leading-4 text-sm ${productTitleColor} ${productTitleAlignment}`} |
|
|
|
{/* productContent */} |
|
|
|
> |
|
|
|
{productContent && ( |
|
|
|
نسخه چاپی علموم تجربه هفتم |
|
|
|
<p className={`${productContentClass}`}>{productContent}</p> |
|
|
|
</h2> |
|
|
|
)} |
|
|
|
{productContent && ( |
|
|
|
{/* productCat */} |
|
|
|
<p |
|
|
|
{productCat && ( |
|
|
|
className={`text-justify mt-2 text-xs leading-6 ${productExcerptTextColor}`} |
|
|
|
<TagDesign1 |
|
|
|
> |
|
|
|
tagClassName={"mt-2 text-xs text-[#246E8A] font-sansbold"} |
|
|
|
این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب |
|
|
|
icon={false} |
|
|
|
دیگری نیز دارد. |
|
|
|
title={"پایه سوم"} |
|
|
|
</p> |
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|
{productCat && ( |
|
|
|
|
|
|
|
<span className={`text-xs font-light ${productCatTextColor}`}> |
|
|
|
|
|
|
|
پایه سوم |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
{/* star */} |
|
|
|
{/* star */} |
|
|
|
{star && ( |
|
|
|
{star && ( |
|
|
|
<div className="flex items-center mt-2"> |
|
|
|
<div className="flex items-center mt-2"> |
|
|
|
<StarRating /> |
|
|
|
<StarRating /> |
|
|
|
<span className="text-xs text-productContent font-bold mr-2"> |
|
|
|
<span className="text-[#707070] text-sm font-sansbold mr-2"> |
|
|
|
39 |
|
|
|
39 |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
{/* price */} |
|
|
|
{/* price / add to cart */} |
|
|
|
{priceHolder && ( |
|
|
|
{priceHolder && ( |
|
|
|
<div |
|
|
|
<div |
|
|
|
className={`flex items-center justify-between ${priceDirection}`} |
|
|
|
className={`flex items-center justify-between ${priceDirection}`} |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
{/* discounted price / price */} |
|
|
|
<div className="mt-2"> |
|
|
|
<div className="mt-2"> |
|
|
|
|
|
|
|
{/* discounted price */} |
|
|
|
<div |
|
|
|
<div |
|
|
|
className={`${ |
|
|
|
className={`${ |
|
|
|
priceDirection.indexOf("col") !== -1 ? "inline" : "flex" |
|
|
|
priceDirection.indexOf("col") !== -1 ? "inline" : "flex" |
|
|
|
}`}
|
|
|
|
}`}
|
|
|
|
> |
|
|
|
> |
|
|
|
<span className="text-xs text-borderColor ml-2">قیمت</span> |
|
|
|
<span className="text-xs text-[#707070] 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-[#707070] mr-0.5"> |
|
|
|
145<span>تومان</span> |
|
|
|
{discountPrice} |
|
|
|
|
|
|
|
<span>تومان</span> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<p className="text-sm text-productPrice font-semibold inline"> |
|
|
|
{/* price */} |
|
|
|
145.000<span>تومان</span> |
|
|
|
<p className="text-sm text-[#132f52] font-sansbold inline"> |
|
|
|
|
|
|
|
{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 ${ |
|
|
|
text={addToCartHolder} |
|
|
|
|
|
|
|
className={`mt-2 p-2 text-xs text-[#132F52] hover:text-white hover:bg-[#132F52] border border-[#132F52] transition duration-500 rounded-2xl ${ |
|
|
|
priceDirection.indexOf("col") !== -1 ? "w-full" : "" |
|
|
|
priceDirection.indexOf("col") !== -1 ? "w-full" : "" |
|
|
|
}`}
|
|
|
|
}`}
|
|
|
|
> |
|
|
|
/> |
|
|
|
اضافه کردن به سبد خرید |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
{productTags && ( |
|
|
|
{productTags && ( |
|
|
|
<div className="mt-2 flex flex-wrap gap-2"> |
|
|
|
<div className="mt-4 flex flex-wrap gap-2"> |
|
|
|
{productTags.map((item, index) => ( |
|
|
|
{productTags.map((item, index) => ( |
|
|
|
<TagDesign1 icon={false} title={item} key={index} /> |
|
|
|
<TagDesign1 icon={false} title={item} key={index} /> |
|
|
|
))} |
|
|
|
))} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
{rangeHolder && ( |
|
|
|
{progressBar && ( |
|
|
|
<div className="bg-rangeBgColor h-3 w-full rounded mt-2"> |
|
|
|
<AnimatedProgressbar1 |
|
|
|
<div |
|
|
|
rangeWidth={"75%"} |
|
|
|
className={`bg-rangeFillBgColor h-3 rounded ${rangeWidth}`} |
|
|
|
parentBg={"bg-[#D3E9FF] rtl mt-5"} |
|
|
|
></div> |
|
|
|
childBg={"bg-[#68A8E6]"} |
|
|
|
</div> |
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -185,30 +212,29 @@ Design1.defaultProps = { |
|
|
|
horizontalImg: false, |
|
|
|
horizontalImg: false, |
|
|
|
// "images/SingleProductwatermelon.png"
|
|
|
|
// "images/SingleProductwatermelon.png"
|
|
|
|
|
|
|
|
|
|
|
|
// icons on product image
|
|
|
|
tooltip: true, |
|
|
|
colors: true, |
|
|
|
|
|
|
|
// product price
|
|
|
|
productTitle: "نسخه چاپی علموم تجربه هفتم", |
|
|
|
discountPrice: true, |
|
|
|
productTitleClass: "text-sm text-justify text-[#246E8A]", |
|
|
|
priceHolder: true, |
|
|
|
|
|
|
|
|
|
|
|
productContent: `این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب دیگری نیز دارد.`, |
|
|
|
|
|
|
|
productContentClass: "mt-2 text-[#707070] text-justify text-xs leading-6", |
|
|
|
|
|
|
|
|
|
|
|
productContent: true, |
|
|
|
|
|
|
|
star: true, |
|
|
|
|
|
|
|
productTags: ["ارسال رایگان", "برچسب های دیگر", "دسته بندی به صورت کادو"], |
|
|
|
|
|
|
|
productCat: true, |
|
|
|
productCat: true, |
|
|
|
rangeHolder: true, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addToCartHolder: true, |
|
|
|
star: true, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
discountPrice: "145", |
|
|
|
|
|
|
|
price: "145.000", |
|
|
|
|
|
|
|
|
|
|
|
productTitleColor: "text-productTitle", |
|
|
|
addToCartHolder: "اضافه کردن به سبد خرید", |
|
|
|
|
|
|
|
|
|
|
|
productExcerptTextColor: "text-productContent", |
|
|
|
progressBar: true, |
|
|
|
|
|
|
|
|
|
|
|
productCatTextColor: "text-darkCrimsonTextColor", |
|
|
|
priceHolder: true, |
|
|
|
// برای درصد دادن به عرض رنج
|
|
|
|
|
|
|
|
rangeWidth: "w-44", |
|
|
|
productTags: ["ارسال رایگان", "برچسب های دیگر", "دسته بندی به صورت کادو"], |
|
|
|
//دی ای وی که محصول داخلش است میتونیم بهش بوردر بدیم
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
productTitleAlignment: "text-justify", |
|
|
|
|
|
|
|
//میتونیم تعیین کنیم که قیمت و دکمه اضاف به سبد خرید کنار یکدیگر باشند یا زیر هم
|
|
|
|
//میتونیم تعیین کنیم که قیمت و دکمه اضاف به سبد خرید کنار یکدیگر باشند یا زیر هم
|
|
|
|
priceDirection: "flex-row", |
|
|
|
priceDirection: "flex-row", |
|
|
|
}; |
|
|
|
}; |
|
|
|