Skip to content

Commit 4520dc1

Browse files
committed
Add PaidAdsFeaturesSection to step 4 of the onboarding flow
1 parent d526dce commit 4520dc1

File tree

1 file changed

+42
-14
lines changed

1 file changed

+42
-14
lines changed

js/src/setup-mc/setup-stepper/setup-paid-ads/setup-paid-ads.js

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ import StepContentFooter from '.~/components/stepper/step-content-footer';
1717
import FaqsSection from '.~/components/paid-ads/faqs-section';
1818
import AppButton from '.~/components/app-button';
1919
import ProductFeedStatusSection from './product-feed-status-section';
20+
import PaidAdsFeaturesSection from './paid-ads-features-section';
2021
import { getProductFeedUrl } from '.~/utils/urls';
2122
import { GUIDE_NAMES } from '.~/constants';
2223
import { API_NAMESPACE } from '.~/data/constants';
2324

2425
export default function SetupPaidAds() {
2526
const adminUrl = useAdminUrl();
2627
const { createNotice } = useDispatchCoreNotices();
28+
const [ showPaidAdsSetup, setShowPaidAdsSetup ] = useState( false );
2729
const [ completing, setCompleting ] = useState( null );
2830

2931
const finishFreeListingsSetup = async ( event ) => {
@@ -56,6 +58,19 @@ export default function SetupPaidAds() {
5658
await finishFreeListingsSetup( event );
5759
};
5860

61+
function createSkipButton( text ) {
62+
return (
63+
<AppButton
64+
isTertiary
65+
data-action="skip-ads"
66+
text={ text }
67+
loading={ completing === 'skip-ads' }
68+
disabled={ completing === 'complete-ads' }
69+
onClick={ finishFreeListingsSetup }
70+
/>
71+
);
72+
}
73+
5974
return (
6075
<StepContent>
6176
<StepContentHeader
@@ -69,30 +84,43 @@ export default function SetupPaidAds() {
6984
) }
7085
/>
7186
<ProductFeedStatusSection />
87+
<PaidAdsFeaturesSection
88+
hideFooterButtons={ showPaidAdsSetup }
89+
skipButton={ createSkipButton(
90+
__( 'Skip this step for now', 'google-listings-and-ads' )
91+
) }
92+
continueButton={
93+
<AppButton
94+
isPrimary
95+
text={ __(
96+
'Create a paid ad campaign',
97+
'google-listings-and-ads'
98+
) }
99+
disabled={ completing === 'skip-ads' }
100+
onClick={ () => setShowPaidAdsSetup( true ) }
101+
/>
102+
}
103+
/>
72104
<FaqsSection />
73-
<StepContentFooter>
105+
<StepContentFooter hidden={ ! showPaidAdsSetup }>
74106
<Flex justify="right" gap={ 4 }>
75-
<AppButton
76-
isTertiary
77-
data-action="skip-ads"
78-
loading={ completing === 'skip-ads' }
79-
disabled={ completing === 'complete-ads' }
80-
onClick={ finishFreeListingsSetup }
81-
>
82-
{ __(
107+
{ createSkipButton(
108+
__(
83109
'Skip paid ads creation',
84110
'google-listings-and-ads'
85-
) }
86-
</AppButton>
111+
)
112+
) }
87113
<AppButton
88114
isPrimary
89115
data-action="complete-ads"
116+
text={ __(
117+
'Complete setup',
118+
'google-listings-and-ads'
119+
) }
90120
loading={ completing === 'complete-ads' }
91121
disabled={ completing === 'skip-ads' }
92122
onClick={ handleCompleteClick }
93-
>
94-
{ __( 'Complete setup', 'google-listings-and-ads' ) }
95-
</AppButton>
123+
/>
96124
</Flex>
97125
</StepContentFooter>
98126
</StepContent>

0 commit comments

Comments
 (0)