From 8a85f8822c8c38bc25a079722f8f81fdbd5b43d4 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Fri, 20 Sep 2024 12:07:38 +0530 Subject: [PATCH] fix: some more changes --- src/Components/PayNowButton.res | 12 +++++-- src/Payments/BankDebitModal.res | 14 +++++++- src/Payments/PaymentMethodsWrapper.res | 14 +++++--- src/Payments/SepaBankDebit.res | 47 ++++++++++++++------------ src/Utilities/DynamicFieldsUtils.res | 1 + 5 files changed, 58 insertions(+), 30 deletions(-) diff --git a/src/Components/PayNowButton.res b/src/Components/PayNowButton.res index b2f6edd0b..d43fe7c21 100644 --- a/src/Components/PayNowButton.res +++ b/src/Components/PayNowButton.res @@ -10,7 +10,7 @@ module Loader = { } } @react.component -let make = () => { +let make = (~onClickHandler=?) => { open RecoilAtoms open Utils let (showLoader, setShowLoader) = React.useState(() => false) @@ -21,7 +21,6 @@ let make = () => { let confirmPayload = sdkHandleConfirmPayment->PaymentBody.confirmPayloadForSDKButton let buttonText = sdkHandleConfirmPayment.buttonText->Option.getOr(localeString.payNowButton) - let handleMessage = (event: Types.event) => { let json = event.data->Identity.anyTypeToJson->getStringFromJson("")->safeParse let dict = json->getDictFromJson @@ -35,6 +34,13 @@ let make = () => { } } + let onClickHandlerFunc = _ => { + switch onClickHandler { + | Some(fn) => fn() + | None => () + } + } + let handleOnClick = _ => { setIsPayNowButtonDisable(_ => true) setShowLoader(_ => true) @@ -45,7 +51,7 @@ let make = () => {