Hide the payment methods screen for personal user in branded-only mode

This commit is contained in:
Narek Zakarian 2025-03-28 19:08:52 +04:00
parent 244de6050b
commit 7050b92a39
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -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;