Created
November 15, 2016 22:20
-
-
Save alekhurst/0c95a54b6db7eb0a48077f7ed5529ba8 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
/** | |
* RoommateMatchingForm.js | |
*/ | |
import React from 'react'; | |
import ZMNavigator from 'components/misc/ZMNavigator'; | |
import { | |
RoommateMatchingQuestion, | |
IntroQuestion, | |
SliderQuestion, | |
MultiChoiceQuestion, | |
} from 'screens/RoommateMatchingQuestion'; | |
import { autobind } from 'core-decorators'; | |
class RoommateMatchingForm extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
currentQuestion: 0, | |
}; | |
} | |
@autobind | |
presentNextQuestion() { | |
let component = () => ( | |
<RoommateMatchingQuestion | |
onPressCloseRoommateMatchingForm={this.props.onPressCloseRoommateMatchingForm} | |
> | |
<MultiChoiceQuestion presentNextQuestion={this.presentNextQuestion} /> | |
</RoommateMatchingQuestion> | |
); | |
this.navigator.push({ | |
component, | |
navigationBarHidden: true, | |
passProps: { | |
type: 'multi_choice', | |
}, | |
}); | |
} | |
render() { | |
let component = () => ( | |
<RoommateMatchingQuestion | |
onPressCloseRoommateMatchingForm={this.props.onPressCloseRoommateMatchingForm} | |
> | |
<IntroQuestion presentNextQuestion={this.presentNextQuestion} /> | |
</RoommateMatchingQuestion> | |
); | |
const firstQuestionRoute = { | |
component, | |
navigationBarHidden: true, | |
passProps: { | |
type: 'intro', | |
}, | |
}; | |
return <ZMNavigator ref={r => this.navigator = r} initialRoute={firstQuestionRoute} />; | |
} | |
} | |
export default RoommateMatchingForm; | |
/** | |
* RoomateMatchingQuestions.js | |
*/ | |
import React from 'react'; | |
import ZMNavigator from 'components/misc/ZMNavigator'; | |
import { | |
RoommateMatchingQuestion, | |
IntroQuestion, | |
SliderQuestion, | |
MultiChoiceQuestion, | |
} from 'screens/RoommateMatchingQuestion'; | |
import { autobind } from 'core-decorators'; | |
class RoommateMatchingForm extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
currentQuestion: 0, | |
}; | |
} | |
@autobind | |
presentNextQuestion() { | |
let component = () => ( | |
<RoommateMatchingQuestion | |
onPressCloseRoommateMatchingForm={this.props.onPressCloseRoommateMatchingForm} | |
> | |
<MultiChoiceQuestion presentNextQuestion={this.presentNextQuestion} /> | |
</RoommateMatchingQuestion> | |
); | |
this.navigator.push({ | |
component, | |
navigationBarHidden: true, | |
passProps: { | |
type: 'multi_choice', | |
}, | |
}); | |
} | |
render() { | |
let component = () => ( | |
<RoommateMatchingQuestion | |
onPressCloseRoommateMatchingForm={this.props.onPressCloseRoommateMatchingForm} | |
> | |
<IntroQuestion presentNextQuestion={this.presentNextQuestion} /> | |
</RoommateMatchingQuestion> | |
); | |
const firstQuestionRoute = { | |
component, | |
navigationBarHidden: true, | |
passProps: { | |
type: 'intro', | |
}, | |
}; | |
return <ZMNavigator ref={r => this.navigator = r} initialRoute={firstQuestionRoute} />; | |
} | |
} | |
export default RoommateMatchingForm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment