@paypal/checkout-components 5.0.336 → 5.0.337
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button.js +1 -1
- package/dist/test/button.js +1 -1
- package/package.json +1 -1
- package/src/ui/buttons/button.jsx +12 -2
package/package.json
CHANGED
|
@@ -111,9 +111,19 @@ export function Button({
|
|
|
111
111
|
|
|
112
112
|
// if no color option is passed in via style props
|
|
113
113
|
if (color === "" || typeof color === "undefined") {
|
|
114
|
-
// if multiple buttons are being rendered (smart stack), we set default color as gold
|
|
115
114
|
// if a single button is rendered, we set color to first option in the fundingSource config
|
|
116
|
-
color =
|
|
115
|
+
color = colors[0];
|
|
116
|
+
|
|
117
|
+
// if multiple buttons are being rendered (smart stack), we set default color as gold > first
|
|
118
|
+
if (multiple) {
|
|
119
|
+
color = "gold";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// validate the first button rendered has a valid color
|
|
124
|
+
// this check is needed to validate the first button in a smart stack gets the correct color
|
|
125
|
+
if (i === 0 && !colors.includes(color)) {
|
|
126
|
+
color = colors[0];
|
|
117
127
|
}
|
|
118
128
|
|
|
119
129
|
// The secondary colors are used to render the smart stack (multiple buttons)
|