@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.213",
3
+ "version": "5.0.214",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -122,10 +122,20 @@ export function getCardConfig() : FundingSourceConfig {
122
122
  },
123
123
 
124
124
  Label: ({ logo, locale, content, custom }) => {
125
- if (custom && custom.label) {
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>{ custom.label }</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
- if (!custom) {
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) => {