Skip to content

Instantly share code, notes, and snippets.

@alekhurst
Created November 15, 2016 22:20
Show Gist options
  • Save alekhurst/0c95a54b6db7eb0a48077f7ed5529ba8 to your computer and use it in GitHub Desktop.
Save alekhurst/0c95a54b6db7eb0a48077f7ed5529ba8 to your computer and use it in GitHub Desktop.
/**
* 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