Rename: BirthdayInputField -> FieldBirthdayInput

This commit is contained in:
Vesa Luusua 2018-01-29 19:01:50 +02:00
parent 23faad9146
commit 3156963f9e
6 changed files with 14 additions and 14 deletions

View file

@ -2,7 +2,7 @@
import React from 'react';
import { reduxForm } from 'redux-form';
import * as validators from '../../util/validators';
import BirthdayInputField from './BirthdayInputField';
import FieldBirthdayInput from './FieldBirthdayInput';
const formName = 'Styleguide.BirthdayInput.Form';
@ -12,7 +12,7 @@ const FormComponent = () => {
const minAgeRequired = validators.ageAtLeast(`Age should be at least ${minAge}`, minAge);
return (
<form>
<BirthdayInputField
<FieldBirthdayInput
id={`${formName}.birthday`}
name="birthday"
label="Date of birth"

View file

@ -6,7 +6,7 @@ import classNames from 'classnames';
import { range } from 'lodash';
import { ValidationError } from '../../components';
import css from './BirthdayInputField.css';
import css from './FieldBirthdayInput.css';
// Since redux-form tracks the onBlur event for marking the field as
// touched (which triggers possible error validation rendering), only
@ -239,7 +239,7 @@ BirthdayInputComponent.propTypes = {
const BirthdayInput = injectIntl(BirthdayInputComponent);
const BirthdayInputFieldComponent = props => {
const FieldBirthdayInputComponent = props => {
const { rootClassName, className, id, label, labelForMonth, labelForYear, input, meta } = props;
const { valid, invalid, touched, error } = meta;
@ -278,7 +278,7 @@ const BirthdayInputFieldComponent = props => {
);
};
BirthdayInputFieldComponent.defaultProps = {
FieldBirthdayInputComponent.defaultProps = {
rootClassName: null,
className: null,
label: null,
@ -286,7 +286,7 @@ BirthdayInputFieldComponent.defaultProps = {
labelForYear: null,
};
BirthdayInputFieldComponent.propTypes = {
FieldBirthdayInputComponent.propTypes = {
rootClassName: string,
className: string,
id: string.isRequired,
@ -297,8 +297,8 @@ BirthdayInputFieldComponent.propTypes = {
meta: object.isRequired,
};
const BirthdayInputField = props => {
return <Field component={BirthdayInputFieldComponent} {...props} />;
const FieldBirthdayInput = props => {
return <Field component={FieldBirthdayInputComponent} {...props} />;
};
export default BirthdayInputField;
export default FieldBirthdayInput;

View file

@ -1,7 +1,6 @@
export { default as ActivityFeed } from './ActivityFeed/ActivityFeed';
export { default as AddImages } from './AddImages/AddImages';
export { default as Avatar, AvatarMedium, AvatarLarge } from './Avatar/Avatar';
export { default as BirthdayInputField } from './BirthdayInputField/BirthdayInputField';
export { default as BookingBreakdown } from './BookingBreakdown/BookingBreakdown';
export {
default as Button,
@ -29,6 +28,7 @@ export { default as EditListingWizard } from './EditListingWizard/EditListingWiz
export { default as ExpandingTextarea } from './ExpandingTextarea/ExpandingTextarea';
export { default as ExternalLink } from './ExternalLink/ExternalLink';
export { default as FilterPanel } from './FilterPanel/FilterPanel';
export { default as FieldBirthdayInput } from './FieldBirthdayInput/FieldBirthdayInput';
export { default as FieldCheckbox } from './FieldCheckbox/FieldCheckbox';
export { default as FieldDateRangeInput } from './FieldDateRangeInput/FieldDateRangeInput';
export { default as FieldGroupCheckbox } from './FieldGroupCheckbox/FieldGroupCheckbox';

View file

@ -11,7 +11,7 @@ import {
Button,
StripeBankAccountTokenInputField,
SelectField,
BirthdayInputField,
FieldBirthdayInput,
TextInputField,
} from '../../components';
import * as validators from '../../util/validators';
@ -235,7 +235,7 @@ const PayoutDetailsFormComponent = props => {
validate={lastNameRequired}
/>
</div>
<BirthdayInputField
<FieldBirthdayInput
className={css.field}
id={birthdayId}
name="birthDate"

View file

@ -2,11 +2,11 @@
import * as ActivityFeed from './components/ActivityFeed/ActivityFeed.example';
import * as AddImages from './components/AddImages/AddImages.example';
import * as Avatar from './components/Avatar/Avatar.example';
import * as BirthdayInputField from './components/BirthdayInputField/BirthdayInputField.example';
import * as BookingBreakdown from './components/BookingBreakdown/BookingBreakdown.example';
import * as Button from './components/Button/Button.example';
import * as CurrencyInputField from './components/CurrencyInputField/CurrencyInputField.example';
import * as ExpandingTextarea from './components/ExpandingTextarea/ExpandingTextarea.example';
import * as FieldBirthdayInput from './components/FieldBirthdayInput/FieldBirthdayInput.example';
import * as FieldCheckbox from './components/FieldCheckbox/FieldCheckbox.example';
import * as FieldDateRangeInput from './components/FieldDateRangeInput/FieldDateRangeInput.example';
import * as FieldGroupCheckbox from './components/FieldGroupCheckbox/FieldGroupCheckbox.example';
@ -77,7 +77,6 @@ export {
ActivityFeed,
AddImages,
Avatar,
BirthdayInputField,
BookingBreakdown,
BookingDatesForm,
Button,
@ -92,6 +91,7 @@ export {
EmailVerificationForm,
EnquiryForm,
ExpandingTextarea,
FieldBirthdayInput,
FieldCheckbox,
FieldDateRangeInput,
FieldGroupCheckbox,