From e9cf1a159a67f9d179782bcd6a0dbf73f0dad9ca Mon Sep 17 00:00:00 2001 From: insvrgent Date: Thu, 13 Feb 2025 11:52:27 +0700 Subject: [PATCH] ok --- src/components/Item.js | 79 ++++++++++++++++++++-------------- src/components/Item.module.css | 6 +-- 2 files changed, 49 insertions(+), 36 deletions(-) diff --git a/src/components/Item.js b/src/components/Item.js index 2f03fa7..7ef6e22 100644 --- a/src/components/Item.js +++ b/src/components/Item.js @@ -168,37 +168,50 @@ const Item = ({ lineHeight: '1rem', marginLeft: 10 }}> - {promoPrice && promoPrice != 0 && promoPrice != '' && -
- Promo -
-} -
- {promoPrice} - {initialPrice} -
+ {promoPrice && promoPrice != 0 && promoPrice != '' ? + <> +
+ Promo {(((initialPrice - promoPrice) / initialPrice) * 100).toFixed(0)}% +
+ +
+ {promoPrice} + {initialPrice} +
+ + : + <> + +
+ {initialPrice} +
+ + } )} @@ -250,7 +263,7 @@ const Item = ({