-
-
Save AndrewIngram/1055c05e8525501a4d45 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
var buildSchema = function(state) { | |
var cityOptions = [ | |
{value: 'LAX', name: 'Los Angeles'}, | |
{value: 'LON', name: 'London'}, | |
{value: 'NYC', name: 'New York'}, | |
{value: 'PAR', name: 'Paris'}, | |
{value: 'N/A', name: 'Other'} | |
]; | |
var featuresOptions = state.amenities; | |
return ( | |
<Schema> | |
<CityField options={cityOptions} /> | |
<Property | |
name="features" | |
label="And finally, what makes your home special?" | |
input={<RadioButtonGroup options={featuresOptions} />} | |
required /> | |
</Schema> | |
); | |
}; | |
var Questionnaire = React.createClass({ | |
mixins: [FluxMixin, StoreWatchMixin("QuestionnaireStore")], | |
getStateFromFlux: function() { | |
return this.getFlux().store('QuestionnaireStore').getState(); | |
}, | |
render: function() { | |
return <Form schema={buildSchema(this.state)} />; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment