mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Rename: DateRangeInputField -> FieldDateRangeInput
This commit is contained in:
parent
071b46c540
commit
23faad9146
14 changed files with 32 additions and 32 deletions
|
|
@ -227,19 +227,19 @@ class DateRangeInputComponent extends Component {
|
|||
|
||||
const startDatePlaceholderTxt =
|
||||
startDatePlaceholderText ||
|
||||
intl.formatMessage({ id: 'DateRangeInputField.startDatePlaceholderText' });
|
||||
intl.formatMessage({ id: 'FieldDateRangeInput.startDatePlaceholderText' });
|
||||
const endDatePlaceholderTxt =
|
||||
endDatePlaceholderText ||
|
||||
intl.formatMessage({ id: 'DateRangeInputField.endDatePlaceholderText' });
|
||||
intl.formatMessage({ id: 'FieldDateRangeInput.endDatePlaceholderText' });
|
||||
const screenReaderInputText =
|
||||
screenReaderInputMessage ||
|
||||
intl.formatMessage({ id: 'DateRangeInputField.screenReaderInputMessage' });
|
||||
intl.formatMessage({ id: 'FieldDateRangeInput.screenReaderInputMessage' });
|
||||
const closeDatePickerText = phrases.closeDatePicker
|
||||
? phrases.closeDatePicker
|
||||
: intl.formatMessage({ id: 'DateRangeInputField.closeDatePicker' });
|
||||
: intl.formatMessage({ id: 'FieldDateRangeInput.closeDatePicker' });
|
||||
const clearDateText = phrases.clearDate
|
||||
? phrases.clearDate
|
||||
: intl.formatMessage({ id: 'DateRangeInputField.clearDate' });
|
||||
: intl.formatMessage({ id: 'FieldDateRangeInput.clearDate' });
|
||||
|
||||
const classes = classNames(css.inputRoot, className, {
|
||||
[css.withMobileMargins]: useMobileMargins,
|
||||
|
|
@ -5,14 +5,14 @@ import moment from 'moment';
|
|||
import { Button } from '../../components';
|
||||
import { required, bookingDatesRequired } from '../../util/validators';
|
||||
import { LINE_ITEM_NIGHT } from '../../util/types';
|
||||
import DateRangeInputField from './DateRangeInputField';
|
||||
import FieldDateRangeInput from './FieldDateRangeInput';
|
||||
|
||||
const FormComponent = props => {
|
||||
const { form, handleSubmit, pristine, submitting, dateInputProps } = props;
|
||||
const submitDisabled = pristine || submitting;
|
||||
return (
|
||||
<form onSubmit={handleSubmit}>
|
||||
<DateRangeInputField {...dateInputProps} />
|
||||
<FieldDateRangeInput {...dateInputProps} />
|
||||
<Button type="submit" disabled={submitDisabled} style={{ marginTop: '24px' }}>
|
||||
Select
|
||||
</Button>
|
||||
|
|
@ -7,9 +7,9 @@ import { propTypes } from '../../util/types';
|
|||
import { ValidationError } from '../../components';
|
||||
|
||||
import DateRangeInput from './DateRangeInput';
|
||||
import css from './DateRangeInputField.css';
|
||||
import css from './FieldDateRangeInput.css';
|
||||
|
||||
class DateRangeInputFieldComponent extends Component {
|
||||
class FieldDateRangeInputComponent extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { focusedInput: null };
|
||||
|
|
@ -139,7 +139,7 @@ class DateRangeInputFieldComponent extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
DateRangeInputFieldComponent.defaultProps = {
|
||||
FieldDateRangeInputComponent.defaultProps = {
|
||||
className: null,
|
||||
rootClassName: null,
|
||||
useMobileMargins: false,
|
||||
|
|
@ -155,7 +155,7 @@ DateRangeInputFieldComponent.defaultProps = {
|
|||
|
||||
const { bool, func, object, oneOf, string } = PropTypes;
|
||||
|
||||
DateRangeInputFieldComponent.propTypes = {
|
||||
FieldDateRangeInputComponent.propTypes = {
|
||||
className: string,
|
||||
rootClassName: string,
|
||||
unitType: propTypes.bookingUnitType.isRequired,
|
||||
|
|
@ -172,9 +172,9 @@ DateRangeInputFieldComponent.propTypes = {
|
|||
onFocusedInputChange: func,
|
||||
};
|
||||
|
||||
const DateRangeInputField = props => {
|
||||
return <Field component={DateRangeInputFieldComponent} {...props} />;
|
||||
const FieldDateRangeInput = props => {
|
||||
return <Field component={FieldDateRangeInputComponent} {...props} />;
|
||||
};
|
||||
|
||||
export { DateRangeInput };
|
||||
export default DateRangeInputField;
|
||||
export default FieldDateRangeInput;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import { renderDeep } from '../../util/test-helpers';
|
||||
import { LINE_ITEM_NIGHT } from '../../util/types';
|
||||
import { DateRangeInput } from './DateRangeInputField';
|
||||
import { DateRangeInput } from './FieldDateRangeInput';
|
||||
|
||||
const noop = () => null;
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ exports[`DateRangeInput matches snapshot 1`] = `
|
|||
className="DateInput_screenReaderMessage DateInput_screenReaderMessage_1"
|
||||
id="DateInput__screen-reader-message-bookingStartDate"
|
||||
>
|
||||
DateRangeInputField.screenReaderInputMessage
|
||||
FieldDateRangeInput.screenReaderInputMessage
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
|
|
@ -69,7 +69,7 @@ exports[`DateRangeInput matches snapshot 1`] = `
|
|||
className="DateInput_screenReaderMessage DateInput_screenReaderMessage_1"
|
||||
id="DateInput__screen-reader-message-bookingEndDate"
|
||||
>
|
||||
DateRangeInputField.screenReaderInputMessage
|
||||
FieldDateRangeInput.screenReaderInputMessage
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -11,7 +11,6 @@ export {
|
|||
} from './Button/Button';
|
||||
export { default as CookieConsent } from './CookieConsent/CookieConsent';
|
||||
export { default as CurrencyInputField } from './CurrencyInputField/CurrencyInputField';
|
||||
export { default as DateRangeInputField } from './DateRangeInputField/DateRangeInputField';
|
||||
export { default as Discussion } from './Discussion/Discussion';
|
||||
export {
|
||||
default as EditListingDescriptionPanel,
|
||||
|
|
@ -31,6 +30,7 @@ export { default as ExpandingTextarea } from './ExpandingTextarea/ExpandingTexta
|
|||
export { default as ExternalLink } from './ExternalLink/ExternalLink';
|
||||
export { default as FilterPanel } from './FilterPanel/FilterPanel';
|
||||
export { default as FieldCheckbox } from './FieldCheckbox/FieldCheckbox';
|
||||
export { default as FieldDateRangeInput } from './FieldDateRangeInput/FieldDateRangeInput';
|
||||
export { default as FieldGroupCheckbox } from './FieldGroupCheckbox/FieldGroupCheckbox';
|
||||
export { default as FieldReviewRating } from './FieldReviewRating/FieldReviewRating';
|
||||
export { default as Footer } from './Footer/Footer';
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import {
|
|||
propTypes,
|
||||
} from '../../util/types';
|
||||
import config from '../../config';
|
||||
import { Form, PrimaryButton, BookingBreakdown, DateRangeInputField } from '../../components';
|
||||
import { Form, PrimaryButton, BookingBreakdown, FieldDateRangeInput } from '../../components';
|
||||
|
||||
import css from './BookingDatesForm.css';
|
||||
|
||||
|
|
@ -175,9 +175,9 @@ export class BookingDatesFormComponent extends Component {
|
|||
const bookingEndLabel = intl.formatMessage({ id: 'BookingDatesForm.bookingEndTitle' });
|
||||
const requiredMessage = intl.formatMessage({ id: 'BookingDatesForm.requiredDate' });
|
||||
const startDateErrorMessage = intl.formatMessage({
|
||||
id: 'DateRangeInputField.invalidStartDate',
|
||||
id: 'FieldDateRangeInput.invalidStartDate',
|
||||
});
|
||||
const endDateErrorMessage = intl.formatMessage({ id: 'DateRangeInputField.invalidEndDate' });
|
||||
const endDateErrorMessage = intl.formatMessage({ id: 'FieldDateRangeInput.invalidEndDate' });
|
||||
|
||||
const hasBookingInfo = startDate && endDate;
|
||||
const bookingInfo = hasBookingInfo ? (
|
||||
|
|
@ -208,7 +208,7 @@ export class BookingDatesFormComponent extends Component {
|
|||
|
||||
return (
|
||||
<Form className={className} onSubmit={this.handleFormSubmit}>
|
||||
<DateRangeInputField
|
||||
<FieldDateRangeInput
|
||||
className={css.bookingDates}
|
||||
name="bookingDates"
|
||||
unitType={unitType}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ exports[`BookingDatesForm matches snapshot without selected dates 1`] = `
|
|||
className={null}
|
||||
onSubmit={[Function]}
|
||||
>
|
||||
<DateRangeInputField
|
||||
<FieldDateRangeInput
|
||||
endDateId="fakeTestForm.bookingEndDate"
|
||||
endDateLabel="BookingDatesForm.bookingEndTitle"
|
||||
endDatePlaceholderText="tomorrow"
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import * as BirthdayInputField from './components/BirthdayInputField/BirthdayInp
|
|||
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 DateRangeInputField from './components/DateRangeInputField/DateRangeInputField.example';
|
||||
import * as ExpandingTextarea from './components/ExpandingTextarea/ExpandingTextarea.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';
|
||||
import * as FieldReviewRating from './components/FieldReviewRating/FieldReviewRating.example';
|
||||
import * as Footer from './components/Footer/Footer.example';
|
||||
|
|
@ -83,7 +83,6 @@ export {
|
|||
Button,
|
||||
Colors,
|
||||
CurrencyInputField,
|
||||
DateRangeInputField,
|
||||
EditListingDescriptionForm,
|
||||
EditListingFeaturesForm,
|
||||
EditListingLocationForm,
|
||||
|
|
@ -94,6 +93,7 @@ export {
|
|||
EnquiryForm,
|
||||
ExpandingTextarea,
|
||||
FieldCheckbox,
|
||||
FieldDateRangeInput,
|
||||
FieldGroupCheckbox,
|
||||
FieldReviewRating,
|
||||
Footer,
|
||||
|
|
|
|||
|
|
@ -102,13 +102,6 @@
|
|||
"DateInput.closeDatePicker": "Close",
|
||||
"DateInput.defaultPlaceholder": "Date input",
|
||||
"DateInput.screenReaderInputMessage": "Date input",
|
||||
"DateRangeInputField.clearDate": "Clear Date",
|
||||
"DateRangeInputField.closeDatePicker": "Close",
|
||||
"DateRangeInputField.endDatePlaceholderText": "Add end date",
|
||||
"DateRangeInputField.invalidEndDate": "The end date is not valid",
|
||||
"DateRangeInputField.invalidStartDate": "The start date is not valid",
|
||||
"DateRangeInputField.screenReaderInputMessage": "Date input",
|
||||
"DateRangeInputField.startDatePlaceholderText": "Add start date",
|
||||
"EditListingDescriptionForm.categoryLabel": "Sauna type",
|
||||
"EditListingDescriptionForm.categoryPlaceholder": "Choose the type of your sauna…",
|
||||
"EditListingDescriptionForm.categoryRequired": "You need to select a category for your sauna.",
|
||||
|
|
@ -194,6 +187,13 @@
|
|||
"EnquiryForm.messageRequired": "A message is required",
|
||||
"EnquiryForm.sendEnquiryError": "Whoops, something went wrong. Please try again.",
|
||||
"EnquiryForm.submitButtonText": "Send enquiry",
|
||||
"FieldDateRangeInput.clearDate": "Clear Date",
|
||||
"FieldDateRangeInput.closeDatePicker": "Close",
|
||||
"FieldDateRangeInput.endDatePlaceholderText": "Add end date",
|
||||
"FieldDateRangeInput.invalidEndDate": "The end date is not valid",
|
||||
"FieldDateRangeInput.invalidStartDate": "The start date is not valid",
|
||||
"FieldDateRangeInput.screenReaderInputMessage": "Date input",
|
||||
"FieldDateRangeInput.startDatePlaceholderText": "Add start date",
|
||||
"FieldReviewRating.star1": "Bad experience - 1 star",
|
||||
"FieldReviewRating.star2": "Not so nice - 2 stars",
|
||||
"FieldReviewRating.star3": "OK - 3 stars",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue