@paypal/checkout-components 5.0.213 → 5.0.214
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/CHANGELOG.md +7 -0
- package/dist/button.js +1 -1
- package/package.json +1 -1
- package/src/funding/card/config.jsx +12 -2
- package/src/ui/buttons/styles/custom.js +3 -3
package/package.json
CHANGED
|
@@ -122,10 +122,20 @@ export function getCardConfig() : FundingSourceConfig {
|
|
|
122
122
|
},
|
|
123
123
|
|
|
124
124
|
Label: ({ logo, locale, content, custom }) => {
|
|
125
|
-
if (custom
|
|
125
|
+
if (custom) {
|
|
126
|
+
const validLabels = {
|
|
127
|
+
checkout: 'Checkout'
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
let label = 'Checkout';
|
|
131
|
+
|
|
132
|
+
if (custom.label && typeof custom.label === 'string' && validLabels[custom.label.toLowerCase()]) {
|
|
133
|
+
label = validLabels[custom.label];
|
|
134
|
+
}
|
|
135
|
+
|
|
126
136
|
return (
|
|
127
137
|
<Fragment>
|
|
128
|
-
<Text>{
|
|
138
|
+
<Text>{ label }</Text>
|
|
129
139
|
<Space />
|
|
130
140
|
</Fragment>
|
|
131
141
|
);
|
|
@@ -4,12 +4,12 @@ import type { CustomStyle } from '../../../types';
|
|
|
4
4
|
import { CLASS } from '../../../constants';
|
|
5
5
|
|
|
6
6
|
export const customStyle = ({ custom } : {| custom? : CustomStyle |}) : string => {
|
|
7
|
-
|
|
7
|
+
const { css } = custom || {};
|
|
8
|
+
|
|
9
|
+
if (!css) {
|
|
8
10
|
return '';
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
const { css } = custom || {};
|
|
12
|
-
|
|
13
13
|
let heightStyle = '';
|
|
14
14
|
let marginStyle = '';
|
|
15
15
|
let style = Object.keys(css).reduce((acc, key) => {
|