mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Refactor the email button, shipping change button, and watermark code to a more modular structure
This commit is contained in:
parent
f470fb0c53
commit
3315fbe116
22 changed files with 438 additions and 237 deletions
|
@ -1,4 +1,5 @@
|
|||
import { useCallback } from '@wordpress/element';
|
||||
import useFastlaneSdk from "./useFastlaneSdk";
|
||||
|
||||
export const useCardChange = ( fastlaneSdk, setCard, setWooBillingAddress ) => {
|
||||
return useCallback( async () => {
|
||||
|
@ -33,3 +34,5 @@ export const useCardChange = ( fastlaneSdk, setCard, setWooBillingAddress ) => {
|
|||
}
|
||||
}, [ fastlaneSdk, setCard ] );
|
||||
};
|
||||
|
||||
export default useCardChange;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { useCallback, useMemo } from '@wordpress/element';
|
||||
import { useDispatch, useSelect } from '@wordpress/data';
|
||||
import useFastlaneSdk from "./useFastlaneSdk";
|
||||
|
||||
export const useCustomerData = () => {
|
||||
const customerData = useSelect( ( select ) =>
|
||||
|
@ -40,3 +41,5 @@ export const useCustomerData = () => {
|
|||
]
|
||||
);
|
||||
};
|
||||
|
||||
export default useCustomerData;
|
||||
|
|
|
@ -33,3 +33,5 @@ export const useShippingAddressChange = (
|
|||
}
|
||||
}, [ fastlaneSdk, setShippingAddress, setWooShippingAddress ] );
|
||||
};
|
||||
|
||||
export default useShippingAddressChange;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue