Skip to content

Instantly share code, notes, and snippets.

@callmephilip
Created June 8, 2016 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callmephilip/517ae44a2eebab817a1881febd910c62 to your computer and use it in GitHub Desktop.
Save callmephilip/517ae44a2eebab817a1881febd910c62 to your computer and use it in GitHub Desktop.
class MainNavigation extends Component {
render() {
const children = this.props.mainNavigation.children.map( (tab, i) => {
return (
<TabBarIOS.Item key={tab.key}
icon={tab.icon}
selectedIcon={tab.selectedIcon}
title={tab.title} onPress={
() => this.props.onNavigate(JumpToAction(i))
}
selected={this.props.mainNavigation.index === i}>
{ this._renderTabContent(tab) }
</TabBarIOS.Item>
);
});
return (
<TabBarIOS>
{children}
</TabBarIOS>
);
}
_renderTabContent(tab) {
return (
<View style={ styles.container }>
<TodoList filter={tab.key} />
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment