Created
November 18, 2016 17:52
-
-
Save killtheliterate/7ac162dda25d705943cd6b7d666fab86 to your computer and use it in GitHub Desktop.
redux-form stuff
This file contains hidden or 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
<form onSubmit={ }> | |
<div className="form-group"> | |
<label className="form-check" htmlFor="send-chat"> | |
<Field | |
name="sendChat" | |
id="send-chat" | |
component="input" | |
type="checkbox" | |
onChange={ this.props.handleSubmit(this.props.initialValues, 'sendChat') } | |
/> | |
Send chat messages from the Timeline to Slack? | |
</label> | |
<label htmlFor="send-chat-color">Chat Messages:</label> | |
<Field | |
className="form-control" | |
component="select" | |
id="send-chat-color" | |
name="chatColor" | |
onChange={ this.props.handleSubmit(this.props.initialValues, 'chatColor') } | |
> | |
{ colors.map(opt => <option value={ opt } key={ opt }>{ opt }</option>) } | |
</Field> | |
</div> | |
</form> | |
const SlackForm = reduxForm({ form: 'slackOptions' })(_SlackForm) | |
{ options ? <SlackForm handleChange={ this.handleChange } initialValues={ options } /> : null } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment