Skip to content

Instantly share code, notes, and snippets.

@fede-rodes
Last active May 6, 2018 19:16
Show Gist options
  • Save fede-rodes/de9d913d3496291a86b4df0993b92d50 to your computer and use it in GitHub Desktop.
Save fede-rodes/de9d913d3496291a86b4df0993b92d50 to your computer and use it in GitHub Desktop.
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