@@ -17,13 +17,15 @@ import StepContentFooter from '.~/components/stepper/step-content-footer';
17
17
import FaqsSection from '.~/components/paid-ads/faqs-section' ;
18
18
import AppButton from '.~/components/app-button' ;
19
19
import ProductFeedStatusSection from './product-feed-status-section' ;
20
+ import PaidAdsFeaturesSection from './paid-ads-features-section' ;
20
21
import { getProductFeedUrl } from '.~/utils/urls' ;
21
22
import { GUIDE_NAMES } from '.~/constants' ;
22
23
import { API_NAMESPACE } from '.~/data/constants' ;
23
24
24
25
export default function SetupPaidAds ( ) {
25
26
const adminUrl = useAdminUrl ( ) ;
26
27
const { createNotice } = useDispatchCoreNotices ( ) ;
28
+ const [ showPaidAdsSetup , setShowPaidAdsSetup ] = useState ( false ) ;
27
29
const [ completing , setCompleting ] = useState ( null ) ;
28
30
29
31
const finishFreeListingsSetup = async ( event ) => {
@@ -56,6 +58,19 @@ export default function SetupPaidAds() {
56
58
await finishFreeListingsSetup ( event ) ;
57
59
} ;
58
60
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
+
59
74
return (
60
75
< StepContent >
61
76
< StepContentHeader
@@ -69,30 +84,43 @@ export default function SetupPaidAds() {
69
84
) }
70
85
/>
71
86
< 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
+ />
72
104
< FaqsSection />
73
- < StepContentFooter >
105
+ < StepContentFooter hidden = { ! showPaidAdsSetup } >
74
106
< 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
+ __ (
83
109
'Skip paid ads creation' ,
84
110
'google-listings-and-ads'
85
- ) }
86
- </ AppButton >
111
+ )
112
+ ) }
87
113
< AppButton
88
114
isPrimary
89
115
data-action = "complete-ads"
116
+ text = { __ (
117
+ 'Complete setup' ,
118
+ 'google-listings-and-ads'
119
+ ) }
90
120
loading = { completing === 'complete-ads' }
91
121
disabled = { completing === 'skip-ads' }
92
122
onClick = { handleCompleteClick }
93
- >
94
- { __ ( 'Complete setup' , 'google-listings-and-ads' ) }
95
- </ AppButton >
123
+ />
96
124
</ Flex >
97
125
</ StepContentFooter >
98
126
</ StepContent >
0 commit comments