From 0a50f8a55b6031193b2842037d3c08fdc5ca2ffd Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Tue, 7 May 2024 12:47:01 +0530 Subject: [PATCH 1/2] fix: compressed layout dynamic fields card --- src/Components/DynamicFields.res | 119 ++++++++++++++++++++----------- 1 file changed, 79 insertions(+), 40 deletions(-) diff --git a/src/Components/DynamicFields.res b/src/Components/DynamicFields.res index 52135e3ab..76732014c 100644 --- a/src/Components/DynamicFields.res +++ b/src/Components/DynamicFields.res @@ -343,16 +343,38 @@ let make = ( let spacedStylesForBiilingDetails = isSpacedInnerLayout ? "p-2" : "my-2" let spacedStylesForCity = isSpacedInnerLayout ? "p-2" : "" + let errorMsgInCompressedLayout = if cardError->String.length > 0 { + cardError + } else if expiryError->String.length > 0 { + expiryError + } else if cvcError->String.length > 0 { + cvcError + } else { + "" + } Array.length > 0}> {<> + Array.length > 0 && !isSpacedInnerLayout}> +
+ {localeString.cardHeader->React.string} +
+
{dynamicFieldsToRenderOutsideBilling ->Array.mapWithIndex((item, index) => {
Int.toString}`} className="flex flex-col w-full place-content-between" style={ReactDOMStyle.make( - ~marginTop=index !== 0 ? themeObj.spacingGridColumn : "", + ~marginTop=index !== 0 && isSpacedInnerLayout ? themeObj.spacingGridColumn : "", ~gridColumnGap=themeObj.spacingGridRow, (), )}> @@ -416,45 +438,61 @@ let make = ( placeholder="123" /> | CardExpiryAndCvc => -
- - -
+ <> +
+ + +
+ String.length > 0}> +
+ {React.string(errorMsgInCompressedLayout)} +
+
+ | Currency(currencyArr) => Date: Tue, 7 May 2024 14:10:01 +0530 Subject: [PATCH 2/2] fix: card comment addressed --- src/Components/DynamicFields.res | 61 +++++++++++++++++--------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/Components/DynamicFields.res b/src/Components/DynamicFields.res index 76732014c..78f1515ee 100644 --- a/src/Components/DynamicFields.res +++ b/src/Components/DynamicFields.res @@ -355,19 +355,6 @@ let make = ( Array.length > 0}> {<> - Array.length > 0 && !isSpacedInnerLayout}> -
- {localeString.cardHeader->React.string} -
-
{dynamicFieldsToRenderOutsideBilling ->Array.mapWithIndex((item, index) => {
{switch item { | CardNumber => - + <> + Array.length > 0 && + !isSpacedInnerLayout}> +
+ {localeString.cardHeader->React.string} +
+
+ + | CardExpiryMonth | CardExpiryYear | CardExpiryMonthAndYear =>