From 7b149c7ed76d2d2350edd4fd031eece879738230 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Wed, 17 Apr 2024 17:16:23 +0530 Subject: [PATCH 01/12] feat: mandate changes for Saved Card flow --- ...edCheckbox.res => SaveDetailsCheckbox.res} | 20 ++++-- src/Components/SavedMethods.res | 37 +++++++++-- src/Hooks/UtilityHooks.res | 13 ++++ src/Payments/CardPayment.res | 31 +++++---- src/Utilities/PaymentBody.res | 63 +++++++++++++------ 5 files changed, 120 insertions(+), 44 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) + } +