Skip to content

Instantly share code, notes, and snippets.

@mbritton
Created April 28, 2017 15:51
Show Gist options
  • Save mbritton/dfd24533e5b2ac5a1890aeeb20cafd52 to your computer and use it in GitHub Desktop.
Save mbritton/dfd24533e5b2ac5a1890aeeb20cafd52 to your computer and use it in GitHub Desktop.
Using PushPin
getRouteRows() {
var routeRows = []
for (var i = 0; i < this.props.routes.length; i++) {
let lItm = null
let infoBox = document.querySelector('.routesColumn')
if (infoBox !== null && infoBox.classList !== null && !infoBox.classList.contains('hidden')) {
lItm = <ListItem
style={ styles.itemStyle } value={ i }
onClick={this.onItemClick}
id={this.props.routes[i]['id']}
primaryText={ this.props.routes[i]['name'] }
key={i}
leftIcon={<PushPin
id={i + 'snip'}
class="hiddenPins"
onClick={this.onPinIconClicked} />} />
} else {
lItm = <ListItem
style={ styles.itemStyle } value={ i }
onClick={this.onItemClick}
id={this.props.routes[i]['id']}
primaryText={ this.props.routes[i]['name'] }
key={i} />
}
routeRows.push( lItm )
}
return routeRows
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment