mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-08 21:52:55 +08:00
Hide the payment methods screen for personal user in branded-only mode
This commit is contained in:
parent
244de6050b
commit
7050b92a39
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
import { CommonHooks, OnboardingHooks } from '../../../../data';
|
||||
import StepWelcome from './StepWelcome';
|
||||
import StepBusiness from './StepBusiness';
|
||||
import StepProducts from './StepProducts';
|
||||
|
@ -56,11 +57,16 @@ const filterSteps = ( steps, conditions ) => {
|
|||
};
|
||||
|
||||
export const getSteps = ( flags ) => {
|
||||
const { ownBrandOnly } = CommonHooks.useWooSettings();
|
||||
const { isCasualSeller } = OnboardingHooks.useBusiness();
|
||||
|
||||
const steps = filterSteps( ALL_STEPS, [
|
||||
// Casual selling: Unlock the "Personal Account" choice.
|
||||
( step ) => flags.canUseCasualSelling || step.id !== 'business',
|
||||
// Skip payment methods screen.
|
||||
( step ) => ! flags.shouldSkipPaymentMethods || step.id !== 'methods',
|
||||
( step ) =>
|
||||
! flags.shouldSkipPaymentMethods &&
|
||||
! ( ownBrandOnly && isCasualSeller && step.id === 'methods' ), // personal user in branded-only mode.
|
||||
] );
|
||||
|
||||
const totalStepsCount = steps.length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue