Merge pull request #2570 from woocommerce/PCP-3535-fix-editor-paypal-buttons-grid

Do not add pay later button in editor (3535)
This commit is contained in:
Emili Castells 2024-10-30 11:46:23 +01:00 committed by GitHub
commit 4457dfed12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -688,7 +688,7 @@ const PayPalComponent = ( {
);
};
const BlockEditorPayPalComponent = () => {
const BlockEditorPayPalComponent = ({ fundingSource } ) => {
const urlParams = {
clientId: 'test',
...config.scriptData.url_params,
@ -701,6 +701,7 @@ const BlockEditorPayPalComponent = () => {
onClick={ ( data, actions ) => {
return false;
} }
fundingSource={ fundingSource }
/>
</PayPalScriptProvider>
);
@ -786,7 +787,7 @@ if ( block_enabled ) {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: <PayPalComponent isEditing={ false } />,
edit: <BlockEditorPayPalComponent />,
edit: <BlockEditorPayPalComponent fundingSource={ 'paypal' }/>,
ariaLabel: config.title,
canMakePayment: () => {
return true;
@ -818,7 +819,9 @@ if ( block_enabled ) {
fundingSource={ fundingSource }
/>
),
edit: <BlockEditorPayPalComponent />,
edit: <BlockEditorPayPalComponent
fundingSource={ fundingSource }
/>,
ariaLabel: config.title,
canMakePayment: async () => {
if ( ! paypalScriptPromise ) {