Extract validation functions in the separate file

This commit is contained in:
ArtemBaskal
2020-07-03 19:10:05 +03:00
parent c12309a1b2
commit 0c4905fa2b
13 changed files with 275 additions and 207 deletions

View File

@@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
import { Field, reduxForm } from 'redux-form';
import { Trans, withTranslation } from 'react-i18next';
import flow from 'lodash/flow';
import { renderInputField, required } from '../../helpers/form';
import { renderInputField } from '../../helpers/form';
import { validateRequiredValue } from '../../helpers/validators';
import { FORM_NAME } from '../../helpers/constants';
const Form = (props) => {
@@ -28,7 +28,7 @@ const Form = (props) => {
placeholder={t('username_placeholder')}
autoComplete="username"
disabled={processing}
validate={[required]}
validate={[validateRequiredValue]}
/>
</div>
<div className="form__group form__group--settings">
@@ -44,7 +44,7 @@ const Form = (props) => {
placeholder={t('password_placeholder')}
autoComplete="current-password"
disabled={processing}
validate={[required]}
validate={[validateRequiredValue]}
/>
</div>
<div className="form-footer">