From 0e5b5abd588732481bfbafb84080b3297bf993c5 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Tue, 16 Apr 2024 17:23:11 +0530 Subject: [PATCH 1/3] feat: mandate Changes for the Saved card screen & SDK Button Loader changes (#289) --- ...edCheckbox.res => SaveDetailsCheckbox.res} | 20 ++++-- src/Components/SavedMethods.res | 40 ++++++++++-- src/Hooks/UtilityHooks.res | 13 ++++ src/Payments/CardPayment.res | 31 +++++---- src/Payments/PaymentMethodsRecord.res | 3 + src/Utilities/PaymentBody.res | 65 +++++++++++++------ src/orca-loader/Hyper.res | 2 +- 7 files changed, 127 insertions(+), 47 deletions(-) rename src/Components/{AnimatedCheckbox.res => SaveDetailsCheckbox.res} (68%) diff --git a/src/Components/AnimatedCheckbox.res b/src/Components/SaveDetailsCheckbox.res similarity index 68% rename from src/Components/AnimatedCheckbox.res rename to src/Components/SaveDetailsCheckbox.res index 7a6fd1726..703c58858 100644 --- a/src/Components/AnimatedCheckbox.res +++ b/src/Components/SaveDetailsCheckbox.res @@ -1,12 +1,14 @@ @react.component -let make = (~isChecked, ~setIsChecked) => { +let make = (~isChecked, ~setIsChecked, ~list: PaymentMethodsRecord.list) => { let {themeObj} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom) + let showFields = Recoil.useRecoilValueFromAtom(RecoilAtoms.showCardFieldsAtom) + let {business} = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom) + let css = `.container { display: flex; cursor: pointer; position: relative; justify-content: center; - align-items: center; } .container input { @@ -46,13 +48,21 @@ let make = (~isChecked, ~setIsChecked) => { ? ("Checkbox--checked", "CheckboxInput--checked", "CheckboxLabel--checked") : ("", "", "") + let valueToBeRendered = if showFields { + localeString.saveCardDetails + } else if business.name !== "" { + localeString.cardTerms(business.name) + } else { + localeString.cardTerms(list.merchant_name) + } +