From 2b047b2085c98eb21877b82d239e91379fb59850 Mon Sep 17 00:00:00 2001 From: Arush Date: Fri, 10 May 2024 00:57:30 +0530 Subject: [PATCH] refactor: refactored ReactDOMStyle.make --- src/CardUtils.res | 2 +- src/Components/Accordion.res | 23 ++++--- src/Components/AccordionContainer.res | 66 +++++++++---------- src/Components/AddBankAccount.res | 30 ++++----- src/Components/AddressPaymentInput.res | 15 ++--- src/Components/Block.res | 11 ++-- src/Components/DropdownField.res | 52 +++++++-------- src/Components/DynamicFields.res | 42 ++++++------ src/Components/InfoElement.res | 15 ++--- src/Components/Input.res | 18 +++--- src/Components/InputField.res | 17 +++-- src/Components/Loader.res | 9 ++- src/Components/Modal.res | 20 +++--- src/Components/PayNowButton.res | 34 +++++----- src/Components/PaymentDropDownField.res | 67 +++++++++---------- src/Components/PaymentField.res | 52 +++++++-------- src/Components/PaymentInputField.res | 54 +++++++--------- src/Components/PaymentShimmer.res | 2 +- src/Components/SavedCardItem.res | 49 ++++++-------- src/Components/SavedMethods.res | 39 ++++++----- src/Components/Terms.res | 4 +- src/PaymentElement.res | 15 ++--- src/PaymentOptions.res | 57 ++++++++-------- src/Payments/ACHBankDebit.res | 17 ++--- src/Payments/ACHBankTransfer.res | 4 +- src/Payments/BacsBankDebit.res | 6 +- src/Payments/BacsBankTransfer.res | 4 +- src/Payments/BankDebitModal.res | 86 ++++++++++++------------- src/Payments/BankTransfersPopup.res | 24 ++++--- src/Payments/BecsBankDebit.res | 4 +- src/Payments/Boleto.res | 4 +- src/Payments/CardPayment.res | 46 ++++++------- src/Payments/GPay.res | 2 +- src/Payments/KlarnaPayment.res | 7 +- src/Payments/PayPal.res | 21 +++--- src/Payments/PaymentMethodsWrapper.res | 2 +- src/Payments/QRCodeDisplay.res | 13 ++-- src/Payments/SepaBankDebit.res | 7 +- src/Payments/SepaBankTransfer.res | 4 +- src/Payments/VoucherDisplay.res | 11 ++-- src/RenderPaymentMethods.res | 19 +++--- src/SingleLineCardPayment.res | 4 +- src/TabCard.res | 15 ++--- src/ThreeDSAuth.res | 5 +- src/orca-log-catcher/ErrorBoundary.res | 19 +++--- 45 files changed, 453 insertions(+), 564 deletions(-) diff --git a/src/CardUtils.res b/src/CardUtils.res index 20d6196e3..8843e523a 100644 --- a/src/CardUtils.res +++ b/src/CardUtils.res @@ -586,7 +586,7 @@ let setRightIconForCvc = (~cardEmpty, ~cardInvalid, ~color, ~cardComplete) => { if cardEmpty { } else if cardInvalid { -
+
} else if cardComplete { diff --git a/src/Components/Accordion.res b/src/Components/Accordion.res index 37de1d309..b9f540c64 100644 --- a/src/Components/Accordion.res +++ b/src/Components/Accordion.res @@ -36,21 +36,20 @@ let make = ( )
setSelectedOption(_ => paymentOption.paymentMethodName)}>
+ style={columnGap: themeObj.spacingUnit}> diff --git a/src/Components/AccordionContainer.res b/src/Components/AccordionContainer.res index a2fd9cf77..3a9ba173d 100644 --- a/src/Components/AccordionContainer.res +++ b/src/Components/AccordionContainer.res @@ -20,35 +20,34 @@ module Loader = {
Belt.Int.toString} - style={ReactDOMStyle.make( - ~minWidth="80px", - ~minHeight="60px", - ~overflowWrap="hidden", - ~borderRadius={borderStyle}, - ~border=`1px solid ${themeObj.borderColor}`, - ~borderBottomStyle={ + style={ + minWidth: "80px", + minHeight: "60px", + overflowWrap: "hidden", + borderRadius: {borderStyle}, + border: `1px solid ${themeObj.borderColor}`, + borderBottomStyle: { (i == cardShimmerCount - 2 && !layoutClass.spacedAccordionItems) || layoutClass.spacedAccordionItems ? "solid" : "hidden" }, - ~borderTopStyle={i == 0 && !layoutClass.spacedAccordionItems ? "hidden" : "solid"}, - ~width="100%", - ~paddingLeft="25px", - ~marginBottom=layoutClass.spacedAccordionItems ? themeObj.spacingAccordionItem : "", - ~cursor="pointer", - (), - )}> + borderTopStyle: {i == 0 && !layoutClass.spacedAccordionItems ? "hidden" : "solid"}, + width: "100%", + paddingLeft: "25px", + marginBottom: layoutClass.spacedAccordionItems ? themeObj.spacingAccordionItem : "", + cursor: "pointer", + }>
@@ -122,12 +121,11 @@ let make = (~paymentOptions: array, ~checkoutEle: React.element) => {
+ style={ + marginTop: themeObj.spacingAccordionItem, + width: "-webkit-fill-available", + marginBottom: themeObj.spacingAccordionItem, + }> {cardOptionDetails ->Array.mapWithIndex((payOption, i) => { let isActive = payOption.paymentMethodName == selectedOption @@ -167,19 +165,17 @@ let make = (~paymentOptions: array, ~checkoutEle: React.element) => {