Skip to content

Commit

Permalink
feat: added prop for hideSavedCardTickIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja committed Jun 10, 2024
1 parent 904a7ba commit ee4f0ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Components/SavedCardItem.res
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ let make = (
~setRequiredFieldsBody,
) => {
let {themeObj, config, localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let {hideExpiredPaymentMethods} = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom)
let {hideExpiredPaymentMethods, hideSavedCardTickIcon} = Recoil.useRecoilValueFromAtom(
RecoilAtoms.optionAtom,
)
let (cardBrand, setCardBrand) = Recoil.useRecoilState(RecoilAtoms.cardBrand)
let (
isCVCValid,
Expand Down Expand Up @@ -116,7 +118,8 @@ let make = (
</div>
</div>
: <div> {React.string(paymentMethodType->Utils.snakeToTitleCase)} </div>}
<RenderIf condition={paymentItem.defaultPaymentMethodSet}>
<RenderIf
condition={!hideSavedCardTickIcon && paymentItem.defaultPaymentMethodSet}>
<Icon size=18 name="checkmark" style={color: themeObj.colorPrimary} />
</RenderIf>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/Types/PaymentType.res
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ type options = {
paymentMethodsHeaderText?: string,
savedPaymentMethodsHeaderText?: string,
hideExpiredPaymentMethods: bool,
hideSavedCardTickIcon: bool,
}
let defaultCardDetails = {
scheme: None,
Expand Down Expand Up @@ -293,6 +294,7 @@ let defaultOptions = {
billingAddress: defaultBillingAddress,
sdkHandleConfirmPayment: defaultSdkHandleConfirmPayment,
hideExpiredPaymentMethods: false,
hideSavedCardTickIcon: false,
}
let getLayout = (str, logger) => {
switch str {
Expand Down Expand Up @@ -975,6 +977,7 @@ let itemToObjMapper = (dict, logger) => {
"paymentMethodsHeaderText",
"savedPaymentMethodsHeaderText",
"hideExpiredPaymentMethods",
"hideSavedCardTickIcon",
],
dict,
"options",
Expand Down Expand Up @@ -1016,6 +1019,7 @@ let itemToObjMapper = (dict, logger) => {
paymentMethodsHeaderText: ?getOptionString(dict, "paymentMethodsHeaderText"),
savedPaymentMethodsHeaderText: ?getOptionString(dict, "savedPaymentMethodsHeaderText"),
hideExpiredPaymentMethods: getBool(dict, "hideExpiredPaymentMethods", false),
hideSavedCardTickIcon: getBool(dict, "hideSavedCardTickIcon", false),
}
}

Expand Down

0 comments on commit ee4f0ae

Please sign in to comment.