From 2619d419607f2c52021875abd388ead861187098 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Fri, 15 Dec 2023 19:19:18 +0530 Subject: [PATCH 1/2] feat: Show Details Paymentb Enhancement --- .../HyperSwitch/Order/OrderUIUtils.res | 6 +-- src/screens/HyperSwitch/Order/ShowOrder.res | 43 +++++++++++++----- .../HyperSwitch/PaymentLogs/PaymentLogs.res | 45 +++++++++++-------- 3 files changed, 58 insertions(+), 36 deletions(-) diff --git a/src/screens/HyperSwitch/Order/OrderUIUtils.res b/src/screens/HyperSwitch/Order/OrderUIUtils.res index 2514bd116..49fa5ba7e 100644 --- a/src/screens/HyperSwitch/Order/OrderUIUtils.res +++ b/src/screens/HyperSwitch/Order/OrderUIUtils.res @@ -19,16 +19,12 @@ module PaymentLogs = { let make = (~id, ~createdAt) => { let {auditTrail} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom let isSmallDevice = MatchMedia.useMatchMedia("(max-width: 700px)") - let showPaymentLogsComp = auditTrail
- - {HSwitchOrderUtils.eventLogHeader} - - +
diff --git a/src/screens/HyperSwitch/Order/ShowOrder.res b/src/screens/HyperSwitch/Order/ShowOrder.res index 6a438365a..bb8945edf 100644 --- a/src/screens/HyperSwitch/Order/ShowOrder.res +++ b/src/screens/HyperSwitch/Order/ShowOrder.res @@ -147,17 +147,6 @@ module OrderInfo = { - LogicUtils.isEmptyDict)}> -
-
- Js.Json.stringifyAny->Belt.Option.getWithDefault("")} - headerText="Payment Metadata" - overrideBackgroundColor="bg-white" - /> -
-
-
{ />
- + { + + }, + renderContentOnTop: None, + }, + ]} + /> + + LogicUtils.isEmptyDict)}> + { +
+ Js.Json.stringifyAny + ->Belt.Option.getWithDefault("")} + overrideBackgroundColor="bg-white" + /> +
+ }, + renderContentOnTop: None, + }, + ]} + />
{ @@ -34,30 +34,37 @@ module PrettyPrintJson = { showToast(~message="Copied to Clipboard!", ~toastType=ToastSuccess, ()) hyperswitchMixPanel( ~pageName=`${url.path->getListHead}`, - ~contextName=`${headerText->toCamelCase}`, + ~contextName=`${headerText->Belt.Option.getWithDefault("")->toCamelCase}`, ~actionName="copied", (), ) } + let copyParsedJson = +
handleOnClickCopy(~parsedValue=parsedJson)} className="cursor-pointer"> + +
+
Js.String2.length > 0}> {<> -
-

- {headerText->React.string} -

-
handleOnClickCopy(~parsedValue=parsedJson)} className="cursor-pointer"> - + Belt.Option.isSome}> +
+

+ {headerText->Belt.Option.getWithDefault("")->React.string} +

+ {copyParsedJson}
+
+
+
+              {parsedJson->React.string}
+            
+ {copyParsedJson}
-
-            {parsedJson->React.string}
-