@@ -75,6 +75,13 @@ function PaidAdsSectionsGroup( { onCampaignChange } ) {
75
75
) ;
76
76
}
77
77
78
+ const ACTION_COMPLETE = 'complete-ads' ;
79
+ const ACTION_SKIP = 'skip-ads' ;
80
+
81
+ /**
82
+ * Renders the onboarding step for setting up the paid ads (Google Ads account and paid campaign)
83
+ * or skipping it, and then completing the onboarding flow.
84
+ */
78
85
export default function SetupPaidAds ( ) {
79
86
const adminUrl = useAdminUrl ( ) ;
80
87
const { createNotice } = useDispatchCoreNotices ( ) ;
@@ -115,16 +122,16 @@ export default function SetupPaidAds() {
115
122
// The status check of Google Ads account connection is included in `campaign.isValid`,
116
123
// because when there is no connected account, it will disable the budget section and set the `amount` to `undefined`.
117
124
// TODO: Add a condition to check Billing setup
118
- const disabledComplete = completing === 'skip-ads' || ! campaign . isValid ;
125
+ const disabledComplete = completing === ACTION_SKIP || ! campaign . isValid ;
119
126
120
127
function createSkipButton ( text ) {
121
128
return (
122
129
< AppButton
123
130
isTertiary
124
131
data-action = "skip-ads"
125
132
text = { text }
126
- loading = { completing === 'skip-ads' }
127
- disabled = { completing === 'complete-ads' }
133
+ loading = { completing === ACTION_SKIP }
134
+ disabled = { completing === ACTION_COMPLETE }
128
135
onClick = { finishFreeListingsSetup }
129
136
/>
130
137
) ;
@@ -155,7 +162,7 @@ export default function SetupPaidAds() {
155
162
'Create a paid ad campaign' ,
156
163
'google-listings-and-ads'
157
164
) }
158
- disabled = { completing === 'skip-ads' }
165
+ disabled = { completing === ACTION_SKIP }
159
166
onClick = { ( ) => setShowPaidAdsSetup ( true ) }
160
167
/>
161
168
}
@@ -179,7 +186,7 @@ export default function SetupPaidAds() {
179
186
'Complete setup' ,
180
187
'google-listings-and-ads'
181
188
) }
182
- loading = { completing === 'complete-ads' }
189
+ loading = { completing === ACTION_COMPLETE }
183
190
disabled = { disabledComplete }
184
191
onClick = { handleCompleteClick }
185
192
/>
0 commit comments