Add methods prop to enable button

This commit is contained in:
carmenmaymo 2025-01-21 14:01:17 +01:00
parent cb7682b362
commit 381fe248e3
No known key found for this signature in database
GPG key ID: 6023F686B0F3102E
2 changed files with 4 additions and 1 deletions

View file

@ -36,7 +36,8 @@ const ALL_STEPS = [
id: 'methods', id: 'methods',
title: __( 'Choose checkout options', 'woocommerce-paypal-payments' ), title: __( 'Choose checkout options', 'woocommerce-paypal-payments' ),
StepComponent: StepPaymentMethods, StepComponent: StepPaymentMethods,
canProceed: () => true, canProceed: ( { methods } ) =>
methods.areOptionalPaymentMethodsEnabled !== null,
}, },
{ {
id: 'complete', id: 'complete',

View file

@ -136,10 +136,12 @@ export const useSteps = () => {
export const useNavigationState = () => { export const useNavigationState = () => {
const products = useProducts(); const products = useProducts();
const business = useBusiness(); const business = useBusiness();
const methods = useOptionalPaymentMethods();
return { return {
products, products,
business, business,
methods,
}; };
}; };