Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: styling issues #696

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/Components/DynamicFields.res
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ let make = (
(dynamicFieldsToRenderInsideBilling->Array.length > 1 || !isOnlyInfoElementPresent)

let spacedStylesForBiilingDetails = isSpacedInnerLayout ? "p-2" : "my-2"
let spacedStylesForCity = isSpacedInnerLayout ? "p-2" : ""

<RenderIf condition={fieldsArr->Array.length > 0}>
{<>
Expand Down Expand Up @@ -511,9 +510,10 @@ let make = (
{React.string(localeString.billingDetailsText)}
</div>
<div
className={`${spacedStylesForCity} flex flex-col ${isSpacedInnerLayout
? "gap-2"
: ""}`}>
className={`flex flex-col`}
style={
gap: isSpacedInnerLayout ? themeObj.spacingGridRow : "",
}>
{dynamicFieldsToRenderInsideBilling
->Array.mapWithIndex((item, index) => {
<div
Expand All @@ -524,15 +524,15 @@ let make = (
| Email => <EmailPaymentInput paymentType />
| PhoneNumber => <PhoneNumberPaymentInput />
| StateAndCity =>
<div className={`flex ${isSpacedInnerLayout ? "gap-1" : ""}`}>
<div className={`flex ${isSpacedInnerLayout ? "gap-4" : ""}`}>
<PaymentField
fieldName=localeString.cityLabel
setValue={setCity}
value=city
onChange={ev => {
let value = ReactEvent.Form.target(ev)["value"]
setCity(prev => {
isValid: value !== "" ? Some(true) : Some(false),
isValid: Some(value !== ""),
value,
errorString: value !== "" ? "" : prev.errorString,
})
Expand Down Expand Up @@ -569,7 +569,7 @@ let make = (
| CountryAndPincode(countryArr) =>
let updatedCountryArray =
countryArr->DropdownField.updateArrayOfStringToOptionsTypeArray
<div className={`flex ${isSpacedInnerLayout ? "gap-1" : ""}`}>
<div className={`flex ${isSpacedInnerLayout ? "gap-4" : ""}`}>
<DropdownField
appearance=config.appearance
fieldName=localeString.countryLabel
Expand Down Expand Up @@ -606,7 +606,7 @@ let make = (
onChange={ev => {
let value = ReactEvent.Form.target(ev)["value"]
setLine1(prev => {
isValid: value !== "" ? Some(true) : Some(false),
isValid: Some(value !== ""),
value,
errorString: value !== "" ? "" : prev.errorString,
})
Expand All @@ -633,7 +633,7 @@ let make = (
onChange={ev => {
let value = ReactEvent.Form.target(ev)["value"]
setLine2(prev => {
isValid: value !== "" ? Some(true) : Some(false),
isValid: Some(value !== ""),
value,
errorString: value !== "" ? "" : prev.errorString,
})
Expand All @@ -659,7 +659,7 @@ let make = (
onChange={ev => {
let value = ReactEvent.Form.target(ev)["value"]
setCity(prev => {
isValid: value !== "" ? Some(true) : Some(false),
isValid: Some(value !== ""),
value,
errorString: value !== "" ? "" : prev.errorString,
})
Expand Down
42 changes: 23 additions & 19 deletions src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ let make = (
let {paymentToken: paymentTokenVal, customerId} = paymentToken

let bottomElement = {
savedMethods
->Array.mapWithIndex((obj, i) => {
let brandIcon = obj->getPaymentMethodBrand
let isActive = paymentTokenVal == obj.paymentToken
<SavedCardItem
key={i->Int.toString}
setPaymentToken
isActive
paymentItem=obj
brandIcon
index=i
savedCardlength
cvcProps
paymentType
setRequiredFieldsBody
/>
})
->React.array
<div className="PickerItemContainer">
{savedMethods
->Array.mapWithIndex((obj, i) =>
<SavedCardItem
key={i->Int.toString}
setPaymentToken
isActive={paymentTokenVal == obj.paymentToken}
paymentItem=obj
brandIcon={obj->getPaymentMethodBrand}
index=i
savedCardlength
cvcProps
paymentType
setRequiredFieldsBody
/>
)
->React.array}
</div>
}

let (isCVCValid, _, cvcNumber, _, _, _, _, _, _, setCvcError) = cvcProps
Expand Down Expand Up @@ -160,7 +160,11 @@ let make = (
| Some("apple_pay") =>
switch applePayToken {
| ApplePayTokenOptional(optToken) =>
ApplePayHelpers.handleApplePayButtonClicked(~sessionObj=optToken, ~componentName, ~paymentMethodListValue)
ApplePayHelpers.handleApplePayButtonClicked(
~sessionObj=optToken,
~componentName,
~paymentMethodListValue,
)
| _ =>
// TODO - To be replaced with proper error message
intent(
Expand Down
4 changes: 2 additions & 2 deletions src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ let make = (
style={
gridColumnGap: {innerLayout === Spaced ? themeObj.spacingGridRow : ""},
}>
<div className={innerLayout === Spaced ? "w-[45%]" : "w-[50%]"}>
<div className={innerLayout === Spaced ? "w-[47%]" : "w-[50%]"}>
<PaymentInputField
fieldName=localeString.validThruText
isValid=isExpiryValid
Expand All @@ -280,7 +280,7 @@ let make = (
name=TestUtils.expiryInputTestId
/>
</div>
<div className={innerLayout === Spaced ? "w-[45%]" : "w-[50%]"}>
<div className={innerLayout === Spaced ? "w-[47%]" : "w-[50%]"}>
<PaymentInputField
fieldName=localeString.cvcTextLabel
isValid=isCVCValid
Expand Down
Loading