@@ -229,7 +229,7 @@ class AnnouncementScreen extends Component {
229
229
__html : marked ( announcement . main . text , markedOptions ) ,
230
230
} }
231
231
/>
232
- { ( announcement . main . cta . label || announcement . main . cta . href ) && (
232
+ { ( announcement . main . cta && ( announcement . main . cta . label && announcement . main . cta . href ) ) && (
233
233
< div className = { classes . mainCtaButton } >
234
234
< Button
235
235
label = { announcement . main . cta . label }
@@ -265,25 +265,27 @@ class AnnouncementScreen extends Component {
265
265
__html : marked ( announcement . spotlight . text , markedOptions ) ,
266
266
} }
267
267
/>
268
- < div className = { classes . mainCtaButton } >
269
- < Button
270
- label = { announcement . spotlight . cta . label }
271
- onClick = { ( ) => {
272
- const {
273
- analytics,
274
- href,
275
- label,
276
- } = announcement . spotlight . cta ;
277
- if ( announcement . spotlight . cta . href . startsWith ( 'http' ) ) {
278
- actions . app . openExternalUrl ( { url : href } ) ;
279
- } else {
280
- window . location . href = `#${ href } ` ;
281
- }
268
+ { announcement . spotlight . cta && (
269
+ < div className = { classes . mainCtaButton } >
270
+ < Button
271
+ label = { announcement . spotlight . cta . label }
272
+ onClick = { ( ) => {
273
+ const {
274
+ analytics,
275
+ href,
276
+ label,
277
+ } = announcement . spotlight . cta ;
278
+ if ( announcement . spotlight . cta . href . startsWith ( 'http' ) ) {
279
+ actions . app . openExternalUrl ( { url : href } ) ;
280
+ } else {
281
+ window . location . href = `#${ href } ` ;
282
+ }
282
283
283
- gaEvent ( analytics . category , analytics . action , label ) ;
284
- } }
285
- />
286
- </ div >
284
+ gaEvent ( analytics . category , analytics . action , label ) ;
285
+ } }
286
+ />
287
+ </ div >
288
+ ) }
287
289
</ div >
288
290
</ div >
289
291
) }
0 commit comments