Skip to content

Instantly share code, notes, and snippets.

@hannigand
Created February 22, 2017 11:58
Show Gist options
  • Save hannigand/cd4751ca222736adeaa5d12394a800bd to your computer and use it in GitHub Desktop.
Save hannigand/cd4751ca222736adeaa5d12394a800bd to your computer and use it in GitHub Desktop.
render() {
let item = null;
let activeItem = null;
if(!this.state.filterVideos || this.state.filterVideos === 'all') {
item = this.state.videos
activeItem = 'all';
} else if (this.state.filterVideos === 'structured') {
item = this.state.structuredVideos;
activeItem = 'structured';
} else if ( this.state.filterVideos === 'unstructured') {
item = this.state.unstructuredVideos;
activeItem = 'unstructured';
}
return (
<View>
<ScrollView>
<View style={ styles.container }>
<InfoBar
message="Please note, your CPD record can take up to 24 hours to update"
/>
<TabBar
filterVideos={ this.filterVideos }
setActive={ activeItem } />
{
item
.map(video =>
<PlaylistItem
style={ { flex: 1 } }
key={ video.id }
video={ video }
updateStatement={ this.updateStatement }
/>
)
}
</View>
</ScrollView>
</View>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment