mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-28 03:09:16 +08:00
35 lines
803 B
JavaScript
35 lines
803 B
JavaScript
import { useEffect } from '@wordpress/element';
|
|
|
|
export const PayPalPlaceOrderContent = ( {
|
|
description,
|
|
placeOrderButtonDescription,
|
|
eventRegistration,
|
|
emitResponse,
|
|
} ) => {
|
|
const { onPaymentSetup } = eventRegistration;
|
|
const { responseTypes } = emitResponse;
|
|
|
|
useEffect(
|
|
() =>
|
|
onPaymentSetup( () => {
|
|
return { type: responseTypes.SUCCESS };
|
|
} ),
|
|
[ onPaymentSetup, responseTypes ]
|
|
);
|
|
|
|
if ( placeOrderButtonDescription ) {
|
|
return (
|
|
<div>
|
|
<p dangerouslySetInnerHTML={ { __html: description } } />
|
|
<p
|
|
style={ { textAlign: 'center' } }
|
|
className="ppcp-place-order-description"
|
|
dangerouslySetInnerHTML={ {
|
|
__html: placeOrderButtonDescription,
|
|
} }
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
return <div dangerouslySetInnerHTML={ { __html: description } } />;
|
|
};
|