mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
21 lines
406 B
JavaScript
21 lines
406 B
JavaScript
|
export const normalizeStyleForFundingSource = ( style, fundingSource ) => {
|
||
|
const commonProps = {};
|
||
|
[ 'shape', 'height' ].forEach( ( prop ) => {
|
||
|
if ( style[ prop ] ) {
|
||
|
commonProps[ prop ] = style[ prop ];
|
||
|
}
|
||
|
} );
|
||
|
|
||
|
switch ( fundingSource ) {
|
||
|
case 'paypal':
|
||
|
return style;
|
||
|
case 'paylater':
|
||
|
return {
|
||
|
color: style.color,
|
||
|
...commonProps,
|
||
|
};
|
||
|
default:
|
||
|
return commonProps;
|
||
|
}
|
||
|
};
|