summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/features/announcements/components/AnnouncementScreen.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/features/announcements/components/AnnouncementScreen.js b/src/features/announcements/components/AnnouncementScreen.js
index 071b8e88c..b58ce6485 100644
--- a/src/features/announcements/components/AnnouncementScreen.js
+++ b/src/features/announcements/components/AnnouncementScreen.js
@@ -234,14 +234,18 @@ class AnnouncementScreen extends Component {
234 <Button 234 <Button
235 label={announcement.main.cta.label} 235 label={announcement.main.cta.label}
236 onClick={() => { 236 onClick={() => {
237 const { analytics } = announcement.main.cta; 237 const {
238 if (announcement.spotlight.cta.href.startsWith('http')) { 238 analytics,
239 actions.app.openExternalUrl({ url: announcement.spotlight.cta.href }); 239 href,
240 label,
241 } = announcement.main.cta;
242 if (announcement.main.cta.href.startsWith('http')) {
243 actions.app.openExternalUrl({ url: href });
240 } else { 244 } else {
241 window.location.href = `#${announcement.main.cta.href}`; 245 window.location.href = `#${href}`;
242 } 246 }
243 247
244 gaEvent(analytics.category, analytics.action, announcement.main.cta.label); 248 gaEvent(analytics.category, analytics.action, label);
245 }} 249 }}
246 /> 250 />
247 </div> 251 </div>
@@ -265,14 +269,18 @@ class AnnouncementScreen extends Component {
265 <Button 269 <Button
266 label={announcement.spotlight.cta.label} 270 label={announcement.spotlight.cta.label}
267 onClick={() => { 271 onClick={() => {
268 const { analytics } = announcement.spotlight.cta; 272 const {
273 analytics,
274 href,
275 label,
276 } = announcement.spotlight.cta;
269 if (announcement.spotlight.cta.href.startsWith('http')) { 277 if (announcement.spotlight.cta.href.startsWith('http')) {
270 actions.app.openExternalUrl({ url: announcement.spotlight.cta.href }); 278 actions.app.openExternalUrl({ url: href });
271 } else { 279 } else {
272 window.location.href = `#${announcement.spotlight.cta.href}`; 280 window.location.href = `#${href}`;
273 } 281 }
274 282
275 gaEvent(analytics.category, analytics.action, announcement.spotlight.cta.label); 283 gaEvent(analytics.category, analytics.action, label);
276 }} 284 }}
277 /> 285 />
278 </div> 286 </div>