Last active
May 6, 2018 19:16
-
-
Save fede-rodes/de9d913d3496291a86b4df0993b92d50 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
class CreateGameScreen extends React.Component { | |
this.state = { | |
curView: 'sportAndTime', | |
sport: '', | |
date: null, | |
time: null, | |
spotId: '', | |
description: '', | |
} | |
handleSportChange = (sport) => { | |
this.setState({ sport }); | |
} | |
handleTimeChange = (time) => { | |
this.setState({ time }); | |
} | |
render() { | |
const { | |
curView, | |
sport, | |
date, | |
time, | |
spotId, | |
description, | |
} = this.state; | |
return( | |
<View> | |
{curView === 'sportAndTime' && ( | |
<SportAndTimeView | |
sport={sport} | |
time={time} | |
onSportChange={this.handleSportChange} | |
onTimeChange={this.handleTimeChange} | |
/> | |
)} | |
{curView === 'pickSpot' && ( | |
<PickSpotView | |
spotId={spotId} | |
onSpotPress={this.handleSpotPress} | |
/> | |
)} | |
//... | |
<Footer | |
numPages={4} | |
currentPage={/* handle this accordingly */} | |
onBack={this.onBack} | |
onNext={this.onNext} | |
disableNext={/* handle this accordingly */} | |
/> | |
</View> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment