Run eslint autofix

This commit is contained in:
Emili Castells Guasch 2024-07-12 12:58:34 +02:00
parent 36a13f6500
commit 11105d913b
141 changed files with 14160 additions and 11825 deletions

View file

@ -1,28 +1,34 @@
import {useEffect} from '@wordpress/element';
import {usePayPalCardFields} from "@paypal/react-paypal-js";
import { useEffect } from '@wordpress/element';
import { usePayPalCardFields } from '@paypal/react-paypal-js';
export const CheckoutHandler = ({getCardFieldsForm, getSavePayment, hasSubscriptionProducts, saveCardText, is_vaulting_enabled}) => {
const {cardFieldsForm} = usePayPalCardFields();
export const CheckoutHandler = ( {
getCardFieldsForm,
getSavePayment,
hasSubscriptionProducts,
saveCardText,
is_vaulting_enabled,
} ) => {
const { cardFieldsForm } = usePayPalCardFields();
useEffect(() => {
getCardFieldsForm(cardFieldsForm)
}, []);
useEffect( () => {
getCardFieldsForm( cardFieldsForm );
}, [] );
if (!is_vaulting_enabled) {
return null;
}
if ( ! is_vaulting_enabled ) {
return null;
}
return (
<>
<input
type="checkbox"
id="save"
name="save"
onChange={(e) => getSavePayment(e.target.checked)}
defaultChecked={hasSubscriptionProducts}
disabled={hasSubscriptionProducts}
/>
<label htmlFor="save">{saveCardText}</label>
</>
)
}
return (
<>
<input
type="checkbox"
id="save"
name="save"
onChange={ ( e ) => getSavePayment( e.target.checked ) }
defaultChecked={ hasSubscriptionProducts }
disabled={ hasSubscriptionProducts }
/>
<label htmlFor="save">{ saveCardText }</label>
</>
);
};