From 509e7ad3e8e5c61194057c05e8e430bef75d8705 Mon Sep 17 00:00:00 2001 From: Sagar naik Date: Tue, 12 Nov 2024 18:58:05 +0530 Subject: [PATCH] fix: payment processed USD string fix (#1725) --- .../PaymentsProcessed/PaymentsProcessed.res | 9 ++++++++- .../PaymentsProcessed/PaymentsProcessedUtils.res | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/screens/NewAnalytics/PaymentAnalytics/PaymentsProcessed/PaymentsProcessed.res b/src/screens/NewAnalytics/PaymentAnalytics/PaymentsProcessed/PaymentsProcessed.res index 22e3c4393..b3021dbc0 100644 --- a/src/screens/NewAnalytics/PaymentAnalytics/PaymentsProcessed/PaymentsProcessed.res +++ b/src/screens/NewAnalytics/PaymentAnalytics/PaymentsProcessed/PaymentsProcessed.res @@ -109,10 +109,17 @@ module PaymentsProcessedHeader = { setGranularity(_ => value) } + let metricType = switch selectedMetric.value->getVariantValueFromString { + | Payment_Processed_Amount => Amount + | _ => Volume + } + + let suffix = metricType == Amount ? "USD" : "" +
- {`${primaryValue->valueFormatter(Amount)} USD`->React.string} // TODO:Currency need to be picked from filter + {`${primaryValue->valueFormatter(metricType)} ${suffix}`->React.string} // TODO:Currency need to be picked from filter
diff --git a/src/screens/NewAnalytics/PaymentAnalytics/PaymentsProcessed/PaymentsProcessedUtils.res b/src/screens/NewAnalytics/PaymentAnalytics/PaymentsProcessed/PaymentsProcessedUtils.res index 9e3af23ef..0fb04941f 100644 --- a/src/screens/NewAnalytics/PaymentAnalytics/PaymentsProcessed/PaymentsProcessedUtils.res +++ b/src/screens/NewAnalytics/PaymentAnalytics/PaymentsProcessed/PaymentsProcessedUtils.res @@ -72,6 +72,13 @@ let paymentsProcessedMapper = ( let title = { text: "Payments Processed", } + + open NewAnalyticsTypes + let metricType = switch xKey->getVariantValueFromString { + | Payment_Processed_Amount => Amount + | _ => Volume + } + { categories: primaryCategories, data: lineGraphData, @@ -80,7 +87,7 @@ let paymentsProcessedMapper = ( tooltipFormatter: tooltipFormatter( ~secondaryCategories, ~title="Payments Processed", - ~metricType=Amount, + ~metricType, ~comparison, ), }