From cfdb83ab2c4b5e7799597728b1442819c58080a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Miko=C5=82ajczyk?= Date: Mon, 28 Oct 2024 09:16:59 +0100 Subject: [PATCH 1/2] [HOTFIX]: Allocation badge epoch fix + metrics max number of digits on mobile --- .../MetricsEpochGridTotalDonations.tsx | 3 +++ .../MetricsEpochGridTotalMatchingFund.tsx | 3 +++ .../MetricsEpochGridUnallocatedValue.tsx | 3 +++ .../components/shared/Layout/LayoutFooter/LayoutFooter.tsx | 4 +++- .../Layout/LayoutTopBarCalendar/LayoutTopBarCalendar.tsx | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalDonations/MetricsEpochGridTotalDonations.tsx b/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalDonations/MetricsEpochGridTotalDonations.tsx index e0eaeea362..fd937ce783 100644 --- a/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalDonations/MetricsEpochGridTotalDonations.tsx +++ b/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalDonations/MetricsEpochGridTotalDonations.tsx @@ -20,6 +20,9 @@ const MetricsEpochGridTotalDonations: FC = cryptoCurrency: 'ethereum', showCryptoSuffix: true, valueCrypto: totalUserDonations, + getFormattedEthValueProps: { + maxNumberOfDigitsToShow: 6, + }, }); return ( diff --git a/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalMatchingFund/MetricsEpochGridTotalMatchingFund.tsx b/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalMatchingFund/MetricsEpochGridTotalMatchingFund.tsx index 026cdf4bff..9cd3d5827f 100644 --- a/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalMatchingFund/MetricsEpochGridTotalMatchingFund.tsx +++ b/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalMatchingFund/MetricsEpochGridTotalMatchingFund.tsx @@ -20,6 +20,9 @@ const MetricsEpochGridTotalMatchingFund: FC = ({ className }) => { ]; useLayoutEffect(() => { - if (!newsletterRef.current || newsletterRef.current.children.length) {return;} + if (!newsletterRef.current || newsletterRef.current.children.length) { + return; + } const script = document.createElement('script'); script.setAttribute( 'src', diff --git a/client/src/components/shared/Layout/LayoutTopBarCalendar/LayoutTopBarCalendar.tsx b/client/src/components/shared/Layout/LayoutTopBarCalendar/LayoutTopBarCalendar.tsx index bfe46f41fa..5fcc19593b 100644 --- a/client/src/components/shared/Layout/LayoutTopBarCalendar/LayoutTopBarCalendar.tsx +++ b/client/src/components/shared/Layout/LayoutTopBarCalendar/LayoutTopBarCalendar.tsx @@ -27,7 +27,7 @@ const LayoutTopBarCalendar = (): ReactElement => { const [isCalendarOpen, setIsCalendarOpen] = useState(false); const allocationInfoText = useMemo(() => { - const epoch = currentEpoch! - 1; + const epoch = isDecisionWindowOpen ? currentEpoch! - 1 : currentEpoch!; const durationMinutes = `${durationToChangeAWInMinutes}${isMobile ? `${t('minutesShort')}` : ` ${t('minutes', { count: durationToChangeAWInMinutes })}`}`; From 95650a8d23d4cbca0b48711f5fb0ef91b288506b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Miko=C5=82ajczyk?= Date: Mon, 28 Oct 2024 10:40:28 +0100 Subject: [PATCH 2/2] eslint fix --- .../MetricsEpochGridTotalDonations.tsx | 4 ++-- .../MetricsEpochGridTotalMatchingFund.tsx | 4 ++-- .../MetricsEpochGridUnallocatedValue.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalDonations/MetricsEpochGridTotalDonations.tsx b/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalDonations/MetricsEpochGridTotalDonations.tsx index fd937ce783..acaee99040 100644 --- a/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalDonations/MetricsEpochGridTotalDonations.tsx +++ b/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalDonations/MetricsEpochGridTotalDonations.tsx @@ -18,11 +18,11 @@ const MetricsEpochGridTotalDonations: FC = const totalUserDonationsValues = getValuesToDisplay({ cryptoCurrency: 'ethereum', - showCryptoSuffix: true, - valueCrypto: totalUserDonations, getFormattedEthValueProps: { maxNumberOfDigitsToShow: 6, }, + showCryptoSuffix: true, + valueCrypto: totalUserDonations, }); return ( diff --git a/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalMatchingFund/MetricsEpochGridTotalMatchingFund.tsx b/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalMatchingFund/MetricsEpochGridTotalMatchingFund.tsx index 9cd3d5827f..792acc43b6 100644 --- a/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalMatchingFund/MetricsEpochGridTotalMatchingFund.tsx +++ b/client/src/components/Metrics/MetricsEpoch/MetricsEpochGridTotalMatchingFund/MetricsEpochGridTotalMatchingFund.tsx @@ -18,11 +18,11 @@ const MetricsEpochGridTotalMatchingFund: FC