update src/components/ButtonDesign/Button/index.js, src/components/SingleProduct/ProductDesign1/index.js and src/components/SingleProduct/VodDesign1/index.js

master
mahdi 3 years ago
parent 54e33be271
commit ed6065d81f
  1. 4
      src/components/ButtonDesign/Button/index.js
  2. 4
      src/components/SingleProduct/ProductDesign1/index.js
  3. 71
      src/components/SingleProduct/VodDesign1/index.js

@ -10,7 +10,7 @@ const Button = ({
return ( return (
<button <button
onClick={onClick} onClick={onClick}
className={`flex items-center justify-center transiton ease-linear duration-200 hover:bg-opacity-70 ${className}`} className={`flex items-center justify-center transiton ease-linear duration-200 ${className}`}
> >
{text} {text}
{icon && ( {icon && (
@ -25,7 +25,7 @@ const Button = ({
export default Button; export default Button;
Button.defaultProps = { Button.defaultProps = {
className: className:
"bg-red-400 text-white hover:bg-gray-900 border border-b-4 border-lightBlueBorderColor rounded text-sm px-4 py-4", "bg-red-400 text-white hover:bg-gray-900 border border-b-4 border-lightBlueBorderColor rounded text-sm px-4 py-4 hover:bg-opacity-90",
text: "اطلاعات بیشتر", text: "اطلاعات بیشتر",
iconHolderClassName: "bg-darkGreenBg mr-2", iconHolderClassName: "bg-darkGreenBg mr-2",

@ -10,6 +10,7 @@ import AnimatedProgressbar1 from "../../ProgressBar/AnimatedProgressbar1";
const Design1 = ({ const Design1 = ({
productHolderClassname, productHolderClassname,
relativeIcons,
discountPricePercent, discountPricePercent,
likeBtn, likeBtn,
discount, discount,
@ -49,7 +50,7 @@ const Design1 = ({
{/* product image */} {/* product image */}
<div className="w-full relative"> <div className="w-full relative">
{/* icons on image */} {/* icons on image */}
<div className="flex flex-col gap-y-2 absolute left-2 top-2"> <div className={`${relativeIcons}`}>
{discountPricePercent && ( {discountPricePercent && (
<ButtonDivTag <ButtonDivTag
icon={false} icon={false}
@ -214,6 +215,7 @@ Design1.defaultProps = {
productHolderClassname: "rounded-lg shadow-sm p-2 border border-[#C3C3C3]", productHolderClassname: "rounded-lg shadow-sm p-2 border border-[#C3C3C3]",
// three buttons on top left side of the holder // three buttons on top left side of the holder
relativeIcons: "flex flex-col items-center gap-y-2 absolute left-2 top-2",
discountPricePercent: "23", discountPricePercent: "23",
likeBtn: true, likeBtn: true,
discount: true, discount: true,

@ -8,12 +8,16 @@ import Tooptip1 from "../../Tooltip/Tooltip1";
import AnimatedProgressbar1 from "../../ProgressBar/AnimatedProgressbar1"; import AnimatedProgressbar1 from "../../ProgressBar/AnimatedProgressbar1";
const VodDesign1 = ({ const VodDesign1 = ({
productHolderClassname, cardClassName,
relativeIcons,
discountPricePercent, discountPricePercent,
likeBtn, likeBtn,
discount, discount,
playButtonClass,
playImage,
tooltip, tooltip,
productTitle, productTitle,
@ -27,6 +31,9 @@ const VodDesign1 = ({
star, star,
discountPrice, discountPrice,
priceHolder,
priceTitle,
price, price,
progressBar, progressBar,
@ -35,9 +42,7 @@ const VodDesign1 = ({
priceDirection, priceDirection,
productTitleAlignment, productTitleAlignment,
priceHolder,
rangeHolder, rangeHolder,
priceTitle,
addToCartHolder, addToCartHolder,
productTitleCategoryHolder, productTitleCategoryHolder,
productTitleCategoryHolderAlignment, productTitleCategoryHolderAlignment,
@ -46,10 +51,11 @@ const VodDesign1 = ({
}) => { }) => {
return ( return (
<> <>
<div className={`${productHolderClassname}`}> <div className={`${cardClassName}`}>
{/* product image */} {/* TOP SECTION === ProductImage && ICONS on image && PlayButton && Tooltip */}
{/* ProductImage */}
<div <div
className="group transition ease-in-out delay-150 duration-300 w-full relative flex items-center justify-center cursor-pointer" className="w-full group relative flex items-center justify-center transition ease-in-out duration-300 cursor-pointer"
style={{ style={{
backgroundImage: `url("images/VodDesign1watermelon.png")`, backgroundImage: `url("images/VodDesign1watermelon.png")`,
backgroundSize: "100% 100%", backgroundSize: "100% 100%",
@ -59,12 +65,12 @@ const VodDesign1 = ({
data-modal-toggle="large-modal" data-modal-toggle="large-modal"
> >
{/* icons on image */} {/* icons on image */}
<div className="flex flex-col gap-y-2 absolute left-2 top-2"> <div className={`${relativeIcons}`}>
{discountPricePercent && ( {discountPricePercent && (
<ButtonDivTag <ButtonDivTag
icon={false} icon={false}
text={discountPricePercent + "%"} text={discountPricePercent + "%"}
className="p-2 bg-[#4ACA5322] text-xs text-[#4ACA53] font-sansbold rounded-md" className="p-2 bg-[#44d04eee] text-xs text-white font-sansbold rounded-md"
/> />
)} )}
{likeBtn && ( {likeBtn && (
@ -82,17 +88,17 @@ const VodDesign1 = ({
text={false} text={false}
icon={"images/SingleProductdiscount.png"} icon={"images/SingleProductdiscount.png"}
iconHolderClassName={""} iconHolderClassName={""}
iconClassName={"w-10"} iconClassName={"w-9"}
/> />
)} )}
</div> </div>
{/* play button */} {/* play button */}
<div <div
className="rounded-full p-4 group-hover:scale-125 transform transition-transform duration-300 bg-[#0D0D0D99]" className={`rounded-full p-4 group-hover:scale-125 transform transition-transform duration-300 ${playButtonClass}`}
// onClick={() => setOpenModal(true)} // onClick={() => setOpenModal(true)}
> >
<img <img
src="images/VodDesign1white-play-button-icon.svg" src={playImage}
alt="" alt=""
className="w-5" className="w-5"
// onClick={() => setOpenModal(true)} // onClick={() => setOpenModal(true)}
@ -100,11 +106,12 @@ const VodDesign1 = ({
</div> </div>
{/* select Color */} {/* select Color */}
{tooltip && ( {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 bg-black">
<Tooptip1 /> <Tooptip1 />
</div> </div>
)} )}
</div> </div>
{/* MiddleSection */}
{/* product content */} {/* product content */}
<div className="px-2"> <div className="px-2">
{/* content */} {/* content */}
@ -128,7 +135,7 @@ const VodDesign1 = ({
</div> </div>
{/* price */} {/* price */}
<div <div
className={`flex ${priceStarHolder} ${priceStarAlignment} justify-between mt-2`} className={`flex ${priceStarHolder} ${priceStarAlignment} justify-between mt-2`}
> >
{priceHolder && ( {priceHolder && (
<div <div
@ -160,13 +167,12 @@ const VodDesign1 = ({
</div> </div>
{/* add to cart */} {/* add to cart */}
{addToCartHolder && ( {addToCartHolder && (
<button <Button
className={`rounded-md px-2 py-3 border text-xs text-productPrice mt-2 hover:bg-darkCrimsonBgColor hover:text-white active:bg-rangeFillBgColor transition duration-500 ${ text={"اضافه کردن به سبد خرید"}
className={`rounded-md px-2 py-3 border text-xs text-productPrice mt-2 hover:bg-darkCrimsonBgColor hover:text-white active:bg-rangeFillBgColor transition duration-500 {
priceDirection.indexOf("col") !== -1 ? "w-full" : "" priceDirection.indexOf("col") !== -1 ? "w-full" : ""
}`} }`}
> />
اضافه کردن به سبد خرید
</button>
)} )}
</div> </div>
)} )}
@ -240,30 +246,33 @@ const VodDesign1 = ({
export default VodDesign1; export default VodDesign1;
VodDesign1.defaultProps = { VodDesign1.defaultProps = {
productHolderClassname: cardClassName: "w-[444px] rounded-lg shadow-sm p-2 border border-[#C3C3C3]",
"min-w-[600px] rounded-lg shadow-sm p-20 border border-[#C3C3C3]",
relativeIcons: "flex flex-col items-center gap-y-2 absolute left-2 top-2",
discountPricePercent: "23", discountPricePercent: "23",
likeBtn: true, likeBtn: true,
discount: true, discount: true,
playButtonClass: "bg-[#0D0D0D99]",
playImage: "images/VodDesign1white-play-button-icon.svg",
productTitle: "نسخه چاپی علموم تجربه هفتم", productTitle: "نسخه چاپی علموم تجربه هفتم",
productTitleClass: "text-sm text-justify text-[#246E8A]", productTitleClass: "text-sm text-justify text-[#246E8A]",
// icons on product image productContent: `این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب دیگری نیز دارد.`,
productColor: true, productContentClass: "mt-2 text-[#707070] text-justify text-xs leading-6",
productCat: true,
star: true,
// product price // product price
discountPrice: true, discountPrice: true,
priceHolder: true, priceHolder: true,
priceTitle: false, priceTitle: true,
productContent: false, productTags: ["ارسال رایگان", "برچسب های دیگر", "دسته بندی به صورت کادو"],
star: true,
productTags: false,
productCat: true,
rangeHolder: true,
addToCartHolder: false, addToCartHolder: true,
productTitleAlignment: "text-justify", productTitleAlignment: "text-justify",
@ -274,6 +283,6 @@ VodDesign1.defaultProps = {
productTitleCategoryHolder: "flex-row", productTitleCategoryHolder: "flex-row",
productTitleCategoryHolderAlignment: "items-center", productTitleCategoryHolderAlignment: "items-center",
priceStarHolder: "flex-row", priceStarHolder: "flex-col",
priceStarAlignment: "items-center", priceStarAlignment: "justify-between",
}; };

Loading…
Cancel
Save