Show buttons in block editing

This commit is contained in:
Alex P 2023-07-11 09:15:36 +03:00
parent 9802495c8c
commit d83eace9b8
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -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: {