Created
February 22, 2017 11:58
-
-
Save hannigand/cd4751ca222736adeaa5d12394a800bd 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
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