Skip to content

Instantly share code, notes, and snippets.

@JWPapi
Created November 23, 2016 10:58
Show Gist options
  • Save JWPapi/2af216e6e1d696e988c07c75900fd7bb to your computer and use it in GitHub Desktop.
Save JWPapi/2af216e6e1d696e988c07c75900fd7bb to your computer and use it in GitHub Desktop.
import React, {Component, PropTypes} from 'react'
import MainPage from './MainPage'
import ClubOverview from './ClubOverview'
import {Page, Navigator, Tabbar, Tab} from 'react-onsenui'
require('moment/locale/de')
class Tabs extends Component {
renderTabs () {
return (
[
{
content: <MainPage key='MainPage' navigator={this.props.navigator} />,
tab: <Tab key='Events' label='Events' icon='fa-calendar'/>
},
{
content: <ClubOverview key='ClubOverview' navigator={this.props.navigator}/>,
tab: <Tab key='Clubs' label='Clubs' icon='fa-glass'/>
}
]
)
}
render () {
console.log(typeof this.renderTabs())
return (
<Page>
<Tabbar renderTabs={() => this.renderTabs()}/>
</Page>
)
}
}
Tabs.propTypes = {
navigator: PropTypes.object
}
const App = () => {
const renderPage = (route, navigator) => {
route.props = route.props || {}
route.props.navigator = navigator
return <route.component key={route.key} {...route.props}/>
}
return <Navigator renderPage={renderPage} initialRoute={{component: Tabs, key: 'Tabs'}}/>
}
export default App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment