Use BirthdayInputField component in form

This commit is contained in:
Kimmo Puputti 2017-06-20 12:37:09 +03:00
parent 9250dd6efd
commit ce357d82e2
3 changed files with 12 additions and 5 deletions

View file

@ -1,7 +1,7 @@
import AddImages from './AddImages/AddImages';
import AuthorInfo from './AuthorInfo/AuthorInfo';
import Avatar from './Avatar/Avatar';
import BirthdayInput from './BirthdayInput/BirthdayInput';
import BirthdayInput, { BirthdayInputField } from './BirthdayInput/BirthdayInput';
import BookingInfo from './BookingInfo/BookingInfo';
import Button, { InlineTextButton } from './Button/Button';
import CloseIcon from './CloseIcon/CloseIcon';
@ -52,6 +52,7 @@ export {
AuthorInfo,
Avatar,
BirthdayInput,
BirthdayInputField,
BookingInfo,
Button,
CloseIcon,

View file

@ -2,6 +2,10 @@
}
.field {
margin-top: 24px;
}
.countries {
border: 1px solid #979797;
}

View file

@ -9,7 +9,7 @@ import {
Button,
StripeBankAccountToken,
Select,
BirthdayInput,
BirthdayInputField,
InputFieldOld,
} from '../../components';
import * as validators from '../../util/validators';
@ -53,6 +53,7 @@ class PayoutDetailsFormComponent extends Component {
className,
country,
currency,
form,
disabled,
handleSubmit,
pristine,
@ -74,6 +75,7 @@ class PayoutDetailsFormComponent extends Component {
})
);
const birthdayId = `${form}.birthday`;
const birthdayLabel = intl.formatMessage({ id: 'PayoutDetailsForm.birthdayLabel' });
const birthdayRequired = validators.required(
intl.formatMessage({
@ -198,13 +200,13 @@ class PayoutDetailsFormComponent extends Component {
component={InputFieldOld}
validate={lastNameRequired}
/>
<Field
<BirthdayInputField
className={css.field}
id={birthdayId}
name="birthDate"
label={birthdayLabel}
format={null}
type="custom"
inputComponent={BirthdayInput}
component={InputFieldOld}
validate={birthdayRequired}
/>
<h2 className={css.subTitle}>