Skip to content

Commit

Permalink
fix: button border changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja committed Jun 11, 2024
1 parent 7429831 commit 0cafc2e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Payments/ApplePay.res
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ let make = (~sessionObj: option<JSON.t>) => {
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;
Expand All @@ -166,7 +166,7 @@ let make = (~sessionObj: option<JSON.t>) => {
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;
Expand Down
1 change: 1 addition & 0 deletions src/Payments/GPay.res
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ let make = (~sessionObj: option<SessionsType.token>, ~thirdPartySessionObj: opti
},
"buttonSizeMode": "fill",
"buttonColor": options.wallets.style.theme == Dark ? "black" : "white",
"buttonRadius": options.wallets.style.buttonRadius,
}
obj->Identity.anyTypeToJson
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/PayPal.res
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
3 changes: 3 additions & 0 deletions src/Types/PaymentType.res
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ type style = {
type_: styleTypeArray,
theme: theme,
height: (heightType, heightType, heightType, heightType),
buttonRadius: int,
}
type wallets = {
walletReturnUrl: string,
Expand Down Expand Up @@ -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: "",
Expand Down Expand Up @@ -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
})
Expand Down

0 comments on commit 0cafc2e

Please sign in to comment.