Skip to content

Commit

Permalink
fix: payment processed USD string fix (#1725)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarnaikjuspay authored Nov 12, 2024
1 parent 38fd02a commit 509e7ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,17 @@ module PaymentsProcessedHeader = {
setGranularity(_ => value)
}

let metricType = switch selectedMetric.value->getVariantValueFromString {
| Payment_Processed_Amount => Amount
| _ => Volume
}

let suffix = metricType == Amount ? "USD" : ""

<div className="w-full px-7 py-8 grid grid-cols-1">
<div className="flex gap-2 items-center">
<div className="text-3xl font-600">
{`${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
</div>
<RenderIf condition={comparison == EnableComparison}>
<StatisticsCard value direction />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -80,7 +87,7 @@ let paymentsProcessedMapper = (
tooltipFormatter: tooltipFormatter(
~secondaryCategories,
~title="Payments Processed",
~metricType=Amount,
~metricType,
~comparison,
),
}
Expand Down

0 comments on commit 509e7ad

Please sign in to comment.