Skip to content

Commit

Permalink
upgraded prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Rasmussen committed Jun 9, 2017
1 parent 0f15f93 commit 1f08e34
Show file tree
Hide file tree
Showing 182 changed files with 1,708 additions and 1,629 deletions.
6 changes: 3 additions & 3 deletions examples/asyncValidation/src/AsyncValidationForm.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'
import {Field, reduxForm} from 'redux-form'
import { Field, reduxForm } from 'redux-form'
import validate from './validate'
import asyncValidate from './asyncValidate'

const renderField = ({
input,
label,
type,
meta: {asyncValidating, touched, error}
meta: { asyncValidating, touched, error }
}) =>
<div>
<label>{label}</label>
Expand All @@ -18,7 +18,7 @@ const renderField = ({
</div>

const AsyncValidationForm = props => {
const {handleSubmit, pristine, reset, submitting} = props
const { handleSubmit, pristine, reset, submitting } = props
return (
<form onSubmit={handleSubmit}>
<Field
Expand Down
2 changes: 1 addition & 1 deletion examples/asyncValidation/src/asyncValidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const asyncValidate = (values /*, dispatch */) => {
return sleep(1000).then(() => {
// simulate server latency
if (['john', 'paul', 'george', 'ringo'].includes(values.username)) {
throw {username: 'That username is taken'}
throw { username: 'That username is taken' }
}
})
}
Expand Down
10 changes: 5 additions & 5 deletions examples/asyncValidation/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import ReactDOM from 'react-dom'
import {Provider} from 'react-redux'
import {createStore, combineReducers} from 'redux'
import {reducer as reduxFormReducer} from 'redux-form'
import { Provider } from 'react-redux'
import { createStore, combineReducers } from 'redux'
import { reducer as reduxFormReducer } from 'redux-form'
import {
App,
Code,
Expand Down Expand Up @@ -52,11 +52,11 @@ let render = () => {

<Markdown content={readme} />

<div style={{textAlign: 'center'}}>
<div style={{ textAlign: 'center' }}>
<a
href="https://codesandbox.io/s/nKlYo387"
target="_blank"
style={{fontSize: '1.5em'}}
style={{ fontSize: '1.5em' }}
>
<i className="fa fa-codepen" /> Open in Sandbox
</a>
Expand Down
4 changes: 2 additions & 2 deletions examples/asyncValidation/src/reducer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {combineReducers} from 'redux'
import {reducer as formReducer} from 'redux-form'
import { combineReducers } from 'redux'
import { reducer as formReducer } from 'redux-form'
import validate from './validate'

const reducer = combineReducers({
Expand Down
10 changes: 5 additions & 5 deletions examples/fieldArrays/src/FieldArraysForm.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import {Field, FieldArray, reduxForm} from 'redux-form'
import { Field, FieldArray, reduxForm } from 'redux-form'
import validate from './validate'

const renderField = ({input, label, type, meta: {touched, error}}) =>
const renderField = ({ input, label, type, meta: { touched, error } }) =>
<div>
<label>{label}</label>
<div>
Expand All @@ -11,7 +11,7 @@ const renderField = ({input, label, type, meta: {touched, error}}) =>
</div>
</div>

const renderHobbies = ({fields, meta: {error}}) =>
const renderHobbies = ({ fields, meta: { error } }) =>
<ul>
<li>
<button type="button" onClick={() => fields.push()}>Add Hobby</button>
Expand All @@ -34,7 +34,7 @@ const renderHobbies = ({fields, meta: {error}}) =>
{error && <li className="error">{error}</li>}
</ul>

const renderMembers = ({fields, meta: {error, submitFailed}}) =>
const renderMembers = ({ fields, meta: { error, submitFailed } }) =>
<ul>
<li>
<button type="button" onClick={() => fields.push({})}>Add Member</button>
Expand Down Expand Up @@ -66,7 +66,7 @@ const renderMembers = ({fields, meta: {error, submitFailed}}) =>
</ul>

const FieldArraysForm = props => {
const {handleSubmit, pristine, reset, submitting} = props
const { handleSubmit, pristine, reset, submitting } = props
return (
<form onSubmit={handleSubmit}>
<Field
Expand Down
10 changes: 5 additions & 5 deletions examples/fieldArrays/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import ReactDOM from 'react-dom'
import {Provider} from 'react-redux'
import {createStore, combineReducers} from 'redux'
import {reducer as reduxFormReducer} from 'redux-form'
import { Provider } from 'react-redux'
import { createStore, combineReducers } from 'redux'
import { reducer as reduxFormReducer } from 'redux-form'
import {
App,
Code,
Expand Down Expand Up @@ -51,11 +51,11 @@ let render = () => {

<Markdown content={readme} />

<div style={{textAlign: 'center'}}>
<div style={{ textAlign: 'center' }}>
<a
href="https://codesandbox.io/s/Ww4QG1Wx"
target="_blank"
style={{fontSize: '1.5em'}}
style={{ fontSize: '1.5em' }}
>
<i className="fa fa-codepen" /> Open in Sandbox
</a>
Expand Down
2 changes: 1 addition & 1 deletion examples/fieldArrays/src/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const validate = values => {
errors.clubName = 'Required'
}
if (!values.members || !values.members.length) {
errors.members = {_error: 'At least one member must be entered'}
errors.members = { _error: 'At least one member must be entered' }
} else {
const membersArrayErrors = []
values.members.forEach((member, memberIndex) => {
Expand Down
11 changes: 8 additions & 3 deletions examples/fieldLevelValidation/src/FieldLevelValidationForm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import {Field, reduxForm} from 'redux-form'
import { Field, reduxForm } from 'redux-form'

const required = value => (value ? undefined : 'Required')
const maxLength = max => value =>
Expand Down Expand Up @@ -32,7 +32,12 @@ export const phoneNumber = value =>
? 'Invalid phone number, must be 10 digits'
: undefined

const renderField = ({input, label, type, meta: {touched, error, warning}}) =>
const renderField = ({
input,
label,
type,
meta: { touched, error, warning }
}) =>
<div>
<label>{label}</label>
<div>
Expand All @@ -44,7 +49,7 @@ const renderField = ({input, label, type, meta: {touched, error, warning}}) =>
</div>

const FieldLevelValidationForm = props => {
const {handleSubmit, pristine, reset, submitting} = props
const { handleSubmit, pristine, reset, submitting } = props
return (
<form onSubmit={handleSubmit}>
<Field
Expand Down
10 changes: 5 additions & 5 deletions examples/fieldLevelValidation/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import ReactDOM from 'react-dom'
import {Provider} from 'react-redux'
import {createStore, combineReducers} from 'redux'
import {reducer as reduxFormReducer} from 'redux-form'
import { Provider } from 'react-redux'
import { createStore, combineReducers } from 'redux'
import { reducer as reduxFormReducer } from 'redux-form'
import {
App,
Code,
Expand Down Expand Up @@ -50,11 +50,11 @@ let render = () => {

<Markdown content={readme} />

<div style={{textAlign: 'center'}}>
<div style={{ textAlign: 'center' }}>
<a
href="https://codesandbox.io/s/PNQYw1kVy"
target="_blank"
style={{fontSize: '1.5em'}}
style={{ fontSize: '1.5em' }}
>
<i className="fa fa-codepen" /> Open in Sandbox
</a>
Expand Down
6 changes: 3 additions & 3 deletions examples/immutable/src/ImmutableForm.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import {Field, reduxForm} from 'redux-form/immutable' // <--- immutable import
import { Field, reduxForm } from 'redux-form/immutable' // <--- immutable import
import validate from './validate'

const renderField = ({input, label, type, meta: {touched, error}}) =>
const renderField = ({ input, label, type, meta: { touched, error } }) =>
<div>
<label>{label}</label>
<div>
Expand All @@ -12,7 +12,7 @@ const renderField = ({input, label, type, meta: {touched, error}}) =>
</div>

const ImmutableForm = props => {
const {handleSubmit, pristine, reset, submitting} = props
const { handleSubmit, pristine, reset, submitting } = props
return (
<form onSubmit={handleSubmit}>
<Field
Expand Down
10 changes: 5 additions & 5 deletions examples/immutable/src/ImmutableValues.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react'
import {values as valuesDecorator} from 'redux-form/immutable'
import {Code} from 'redux-form-website-template'
import { values as valuesDecorator } from 'redux-form/immutable'
import { Code } from 'redux-form-website-template'

/**
* This is just like the Values component that the other examples import, except that it works
* with Immutable JS.
*/
const ImmutableValues = ({form}) => {
const decorator = valuesDecorator({form})
const component = ({values}) => {
const ImmutableValues = ({ form }) => {
const decorator = valuesDecorator({ form })
const component = ({ values }) => {
return (
<div>
<h2>Values</h2>
Expand Down
8 changes: 4 additions & 4 deletions examples/immutable/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import ReactDOM from 'react-dom'
import {Provider} from 'react-redux'
import {createStore} from 'redux'
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import {
App,
Code,
Expand Down Expand Up @@ -50,11 +50,11 @@ let render = () => {

<Markdown content={readme} />

<div style={{textAlign: 'center'}}>
<div style={{ textAlign: 'center' }}>
<a
href="https://codesandbox.io/s/ZVGJQBJMw"
target="_blank"
style={{fontSize: '1.5em'}}
style={{ fontSize: '1.5em' }}
>
<i className="fa fa-codepen" /> Open in Sandbox
</a>
Expand Down
6 changes: 3 additions & 3 deletions examples/immutable/src/reducer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {combineReducers} from 'redux-immutablejs'
import {reducer as form} from 'redux-form/immutable' // <--- immutable import
import { combineReducers } from 'redux-immutablejs'
import { reducer as form } from 'redux-form/immutable' // <--- immutable import

const reducer = combineReducers({form})
const reducer = combineReducers({ form })

export default reducer
10 changes: 5 additions & 5 deletions examples/initializeFromState/src/InitializeFromStateForm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import {connect} from 'react-redux'
import {Field, reduxForm} from 'redux-form'
import {load as loadAccount} from './account'
import { connect } from 'react-redux'
import { Field, reduxForm } from 'redux-form'
import { load as loadAccount } from './account'
const data = {
// used to populate "account" reducer when "Load" is clicked
firstName: 'Jane',
Expand All @@ -15,7 +15,7 @@ const data = {
const colors = ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet']

let InitializeFromStateForm = props => {
const {handleSubmit, load, pristine, reset, submitting} = props
const { handleSubmit, load, pristine, reset, submitting } = props
return (
<form onSubmit={handleSubmit}>
<div>
Expand Down Expand Up @@ -114,7 +114,7 @@ InitializeFromStateForm = connect(
state => ({
initialValues: state.account.data // pull initial values from account reducer
}),
{load: loadAccount} // bind account loading action creator
{ load: loadAccount } // bind account loading action creator
)(InitializeFromStateForm)

export default InitializeFromStateForm
2 changes: 1 addition & 1 deletion examples/initializeFromState/src/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ const reducer = (state = {}, action) => {
/**
* Simulates data loaded into this reducer from somewhere
*/
export const load = data => ({type: LOAD, data})
export const load = data => ({ type: LOAD, data })

export default reducer
10 changes: 5 additions & 5 deletions examples/initializeFromState/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import ReactDOM from 'react-dom'
import {Provider} from 'react-redux'
import {createStore, combineReducers} from 'redux'
import {reducer as reduxFormReducer} from 'redux-form'
import { Provider } from 'react-redux'
import { createStore, combineReducers } from 'redux'
import { reducer as reduxFormReducer } from 'redux-form'
import {
App,
Code,
Expand Down Expand Up @@ -54,11 +54,11 @@ let render = () => {

<Markdown content={readme} />

<div style={{textAlign: 'center'}}>
<div style={{ textAlign: 'center' }}>
<a
href="https://codesandbox.io/s/MQnD536Km"
target="_blank"
style={{fontSize: '1.5em'}}
style={{ fontSize: '1.5em' }}
>
<i className="fa fa-codepen" /> Open in Sandbox
</a>
Expand Down
19 changes: 12 additions & 7 deletions examples/material-ui/src/MaterialUiForm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import {Field, reduxForm} from 'redux-form'
import { Field, reduxForm } from 'redux-form'
import TextField from 'material-ui/TextField'
import {RadioButton, RadioButtonGroup} from 'material-ui/RadioButton'
import { RadioButton, RadioButtonGroup } from 'material-ui/RadioButton'
import Checkbox from 'material-ui/Checkbox'
import SelectField from 'material-ui/SelectField'
import MenuItem from 'material-ui/MenuItem'
Expand Down Expand Up @@ -30,7 +30,12 @@ const validate = values => {
return errors
}

const renderTextField = ({input, label, meta: {touched, error}, ...custom}) =>
const renderTextField = ({
input,
label,
meta: { touched, error },
...custom
}) =>
<TextField
hintText={label}
floatingLabelText={label}
Expand All @@ -39,14 +44,14 @@ const renderTextField = ({input, label, meta: {touched, error}, ...custom}) =>
{...custom}
/>

const renderCheckbox = ({input, label}) =>
const renderCheckbox = ({ input, label }) =>
<Checkbox
label={label}
checked={input.value ? true : false}
onCheck={input.onChange}
/>

const renderRadioGroup = ({input, ...rest}) =>
const renderRadioGroup = ({ input, ...rest }) =>
<RadioButtonGroup
{...input}
{...rest}
Expand All @@ -57,7 +62,7 @@ const renderRadioGroup = ({input, ...rest}) =>
const renderSelectField = ({
input,
label,
meta: {touched, error},
meta: { touched, error },
children,
...custom
}) =>
Expand All @@ -71,7 +76,7 @@ const renderSelectField = ({
/>

const MaterialUiForm = props => {
const {handleSubmit, pristine, reset, submitting} = props
const { handleSubmit, pristine, reset, submitting } = props
return (
<form onSubmit={handleSubmit}>
<div>
Expand Down
Loading

0 comments on commit 1f08e34

Please sign in to comment.