mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 17:51:41 +08:00
20 lines
524 B
JavaScript
20 lines
524 B
JavaScript
|
import { useMemo } from '@wordpress/element';
|
||
|
import { combineStyles } from '../../../../../ppcp-button/resources/js/modules/Helper/PaymentButtonHelpers';
|
||
|
|
||
|
const useButtonStyles = ( buttonConfig, ppcpConfig ) => {
|
||
|
return useMemo( () => {
|
||
|
const styles = combineStyles(
|
||
|
ppcpConfig?.button || {},
|
||
|
buttonConfig?.button || {}
|
||
|
);
|
||
|
|
||
|
if ( styles.MiniCart && styles.MiniCart.type === 'buy' ) {
|
||
|
styles.MiniCart.type = 'pay';
|
||
|
}
|
||
|
|
||
|
return styles;
|
||
|
}, [ buttonConfig, ppcpConfig ] );
|
||
|
};
|
||
|
|
||
|
export default useButtonStyles;
|