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