From 0cafc2ef88a5d030c192161d4bcbad8c6a190bbc Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Tue, 11 Jun 2024 15:00:07 +0530 Subject: [PATCH] fix: button border changes --- src/Payments/ApplePay.res | 4 ++-- src/Payments/GPay.res | 1 + src/Payments/PayPal.res | 2 +- src/Types/PaymentType.res | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Payments/ApplePay.res b/src/Payments/ApplePay.res index 2cf65d806..b677684ff 100644 --- a/src/Payments/ApplePay.res +++ b/src/Payments/ApplePay.res @@ -148,7 +148,7 @@ let make = (~sessionObj: option) => { height: 3rem; display: flex; cursor: pointer; - border-radius: 2px; + border-radius: ${options.wallets.style.buttonRadius->Int.toString}px; } .apple-pay-button-white-with-text { -apple-pay-button-style: white; @@ -166,7 +166,7 @@ let make = (~sessionObj: option) => { display: inline-flex; justify-content: center; font-size: 12px; - border-radius: 5px; + border-radius: ${options.wallets.style.buttonRadius->Int.toString}px; padding: 0px; box-sizing: border-box; min-width: 200px; diff --git a/src/Payments/GPay.res b/src/Payments/GPay.res index 95c0308e8..997a4cfc7 100644 --- a/src/Payments/GPay.res +++ b/src/Payments/GPay.res @@ -216,6 +216,7 @@ let make = (~sessionObj: option, ~thirdPartySessionObj: opti }, "buttonSizeMode": "fill", "buttonColor": options.wallets.style.theme == Dark ? "black" : "white", + "buttonRadius": options.wallets.style.buttonRadius, } obj->Identity.anyTypeToJson } diff --git a/src/Payments/PayPal.res b/src/Payments/PayPal.res index 63386baf3..7098952cf 100644 --- a/src/Payments/PayPal.res +++ b/src/Payments/PayPal.res @@ -87,7 +87,7 @@ let make = () => { display: "inline-block", color: textColor, height: `${height->Int.toString}px`, - borderRadius: "2px", + borderRadius: `${options.wallets.style.buttonRadius->Int.toString}px`, width: "100%", backgroundColor: buttonColor, } diff --git a/src/Types/PaymentType.res b/src/Types/PaymentType.res index afbf6d5fa..a9b3c807c 100644 --- a/src/Types/PaymentType.res +++ b/src/Types/PaymentType.res @@ -87,6 +87,7 @@ type style = { type_: styleTypeArray, theme: theme, height: (heightType, heightType, heightType, heightType), + buttonRadius: int, } type wallets = { walletReturnUrl: string, @@ -255,6 +256,7 @@ let defaultStyle = { type_: (ApplePay(Default), GooglePay(Default), Paypal(Paypal)), theme: Light, height: (ApplePay(48), GooglePay(48), Paypal(48), Klarna(48)), + buttonRadius: 2, } let defaultWallets = { walletReturnUrl: "", @@ -768,6 +770,7 @@ let getStyle = (dict, str, logger) => { type_: getWarningString(json, "type", "", ~logger)->getTypeArray(logger), theme: getWarningString(json, "theme", "", ~logger)->getTheme(logger), height: getNumberWithWarning(json, "height", 48, ~logger)->getHeightArray(logger), + buttonRadius: getNumberWithWarning(json, "buttonRadius", 2, ~logger), } style })