Skip to content

Commit 6e6149d

Browse files
authored
Merge pull request #109 from back4app/fix_api_reference_event_not_firing
fix: API Reference event not firing
2 parents dcfba5b + e931b35 commit 6e6149d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/Sidebar/SidebarSection.react.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import { Link } from 'react-router';
1010
import React from 'react';
1111
import styles from 'components/Sidebar/Sidebar.scss';
1212

13-
const sendEvent = name => {
14-
if(name === 'API Reference')
15-
back4AppNavigation && back4AppNavigation.atApiReferenceIntroEvent()
13+
const sendEvent = () => {
14+
back4AppNavigation && back4AppNavigation.atApiReferenceIntroEvent && back4AppNavigation.atApiReferenceIntroEvent()
1615
}
1716

1817
let SidebarSection = ({ active, children, name, link, icon, style, primaryBackgroundColor, secondaryBackgroundColor }) => {
@@ -27,7 +26,7 @@ let SidebarSection = ({ active, children, name, link, icon, style, primaryBackgr
2726

2827
const linkComponent = link.startsWith('/')
2928
? <Link style={style} className={styles.section_header} to={{ pathname: link || '' }}>{iconContent}<span>{name}</span></Link>
30-
: <a style={style} className={styles.section_header_external_link} href={link} target="_blank" onClick={() => sendEvent(name)}>{iconContent}<span>{name}</span></a>;
29+
: <a style={style} className={styles.section_header_external_link} href={link} target="_blank" onClick={() => sendEvent()}>{iconContent}<span>{name}</span></a>;
3130
return (
3231
<div className={classes.join(' ')}>
3332
{active ?

0 commit comments

Comments
 (0)