mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-12 01:18:39 +08:00
Show buttons in block editing
This commit is contained in:
parent
9802495c8c
commit
d83eace9b8
1 changed files with 7 additions and 2 deletions
|
@ -16,6 +16,7 @@ const PayPalComponent = ({
|
|||
emitResponse,
|
||||
activePaymentMethod,
|
||||
shippingData,
|
||||
isEditing,
|
||||
}) => {
|
||||
const {onPaymentSetup, onCheckoutAfterProcessingWithError} = eventRegistration;
|
||||
const {responseTypes} = emitResponse;
|
||||
|
@ -125,6 +126,10 @@ const PayPalComponent = ({
|
|||
};
|
||||
|
||||
const handleClick = (data, actions) => {
|
||||
if (isEditing) {
|
||||
return actions.reject();
|
||||
}
|
||||
|
||||
window.ppcpFundingSource = data.fundingSource;
|
||||
|
||||
onClick();
|
||||
|
@ -259,8 +264,8 @@ if (config.scriptData.continuation) {
|
|||
registerMethod({
|
||||
name: config.id,
|
||||
label: <div dangerouslySetInnerHTML={{__html: config.title}}/>,
|
||||
content: <PayPalComponent/>,
|
||||
edit: <b>TODO: editing</b>,
|
||||
content: <PayPalComponent isEditing={false}/>,
|
||||
edit: <PayPalComponent isEditing={true}/>,
|
||||
ariaLabel: config.title,
|
||||
canMakePayment: () => config.enabled,
|
||||
supports: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue