Last active
December 5, 2016 20:31
-
-
Save EdwinGuzman/a1da42dfc5907aa64421e4cc2c0abb1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App.jsx | |
import HomepageRow from 'dgx-homepage-row-component'; | |
import HomepageStaffPicks from 'dgx-homepage-staff-picks-component'; | |
import { gaUtils } from 'dgx-react-ga'; | |
const trackHomepage = gaUtils.trackEvent('Homepage'); | |
class App extends React.Component { | |
// ... | |
render () { | |
// ... | |
<Homepagerow trackHomepage={trackHomepage} content={<HomepageStaffPicks />} /> | |
} | |
} | |
// HomepageStaffPicks.jsx | |
// Inside this Homepagerow component, we can use the trackHomepage prop to trigger an event in the sidebar for the title: | |
<a href={link} onClick={this.props.trackHomepage('Staff Picks', 'Heading')}>Staff Picks</a> | |
// And in the feature component of the Homepagestaffpicks component for a book image: | |
<a href={link} onClick={this.props.trackHomepage('Staff Picks', 'book image')}><img … /> </a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment