R
R
Ramfan2018-08-30 21:07:04
React
Ramfan, 2018-08-30 21:07:04

How to style a Redux Form with fela.js?

I have a Redux Form and I need to style the inputs

const renderField = ({ input, label, type, meta: { touched, error, warning }}) => (
  <div>
        <div>
                <input {...input} placeholder={label} type={type} style={touched? error?
                    {borderColor: 'red'}:
                    {borderColor:''}:
                    {borderColor:''}} />
        </div>
    </div>
);

const Auth = props => {
    const { handleSubmit, pristine, reset, submitting, textVal } = props;

    return (
        <form onSubmit={handleSubmit}>
            <div>
                <div>
                    <Field
                        name="email"
                        component={renderField}
                        type="email"
                        label="[email protected]"

                    />
                </div>
            </div>
            <div>
                <div>
                    <Field
                        name="password"
                        component={renderField}
                        type="password"
                        label="Password"
                    />
                </div>


            </div>


            <div>
                <ButtonStyle type="submit" name="Submit" disabled={pristine || submitting} >
                    {textVal}
                </ButtonStyle>
            </div>
        </form>
    )
}

export default reduxForm({
    form: 'AuthForm',
    initialValues:  {
        password: '',
        email: '',
    },
    validate
})(Auth)

How to style using fela... there is little information in the documentation, maybe knowledgeable people will tell you?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question