From 80a2624cc9c5f15453430e26428e89a77eaa79cf Mon Sep 17 00:00:00 2001 From: Lucca Date: Fri, 31 Jan 2025 09:11:05 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20improve=20need=20help=20pri?= =?UTF-8?q?ce=20card?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Price/ItemPriceCard.tsx | 59 ++++++++++++++++++------------ translation/en.json | 4 +- translation/pt.json | 4 +- 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/components/Price/ItemPriceCard.tsx b/components/Price/ItemPriceCard.tsx index 357cf5f..9e71054 100644 --- a/components/Price/ItemPriceCard.tsx +++ b/components/Price/ItemPriceCard.tsx @@ -146,10 +146,14 @@ const ItemPriceCard = (props: Props) => { if (!hasTrades) return false; - if (!price) return true; + const res = { + needPricing: priceStatus.waitingTrades.needPricing, + needVoting: priceStatus.waitingTrades.needVoting, + }; - if (differenceInCalendarDays(new Date(), new Date(price.addedAt)) > 15 && hasTrades) - return true; + if (!price) return res; + + if (differenceInCalendarDays(new Date(), new Date(price.addedAt)) > 15 && hasTrades) return res; return false; }, [user, priceStatus, price]); @@ -207,7 +211,7 @@ const ItemPriceCard = (props: Props) => { - {needHelp && } + {!!needHelp && } { - const { item } = props; + const { item, helpData } = props; const [hideHelp, setHideHelp] = useState(false); const t = useTranslations(); @@ -399,24 +404,32 @@ const HelpNeeded = (props: HelpNeededProps) => { > {t('Feedback.price-update-txt')} - - + {!!helpData.needPricing && ( + + )} + {!!helpData.needVoting && ( + + )}