mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Run eslint autofix
This commit is contained in:
parent
36a13f6500
commit
11105d913b
141 changed files with 14160 additions and 11825 deletions
|
@ -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>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue