Skip to content

Instantly share code, notes, and snippets.

@killtheliterate
Created November 18, 2016 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save killtheliterate/7ac162dda25d705943cd6b7d666fab86 to your computer and use it in GitHub Desktop.
Save killtheliterate/7ac162dda25d705943cd6b7d666fab86 to your computer and use it in GitHub Desktop.
redux-form stuff
<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