mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-31 02:26:50 +10:00
Rename: CurrencyInputField -> FieldCurrencyInput
This commit is contained in:
parent
3156963f9e
commit
607c25b61c
7 changed files with 18 additions and 18 deletions
|
|
@ -7,7 +7,7 @@ import en from 'react-intl/locale-data/en';
|
|||
import fi from 'react-intl/locale-data/fi';
|
||||
import { currencyConfig } from '../../util/test-data';
|
||||
import * as validators from '../../util/validators';
|
||||
import CurrencyInputField, { CurrencyInput } from './CurrencyInputField';
|
||||
import FieldCurrencyInput, { CurrencyInput } from './FieldCurrencyInput';
|
||||
|
||||
const currencyConfigUSD = {
|
||||
...currencyConfig,
|
||||
|
|
@ -81,14 +81,14 @@ export const defaultValueWithFiEUR = {
|
|||
group: 'custom inputs',
|
||||
};
|
||||
|
||||
const formName = 'Styleguide.CurrencyInputField.Form';
|
||||
const formName = 'Styleguide.FieldCurrencyInput.Form';
|
||||
|
||||
const FormComponent = props => {
|
||||
const { form } = props;
|
||||
const required = validators.required('This field is required');
|
||||
return (
|
||||
<form>
|
||||
<CurrencyInputField
|
||||
<FieldCurrencyInput
|
||||
name="price"
|
||||
id={`${form}.price`}
|
||||
label="Set price:"
|
||||
|
|
@ -23,7 +23,7 @@ import {
|
|||
import { propTypes } from '../../util/types';
|
||||
import * as log from '../../util/log';
|
||||
|
||||
import css from './CurrencyInputField.css';
|
||||
import css from './FieldCurrencyInput.css';
|
||||
|
||||
const { Money } = sdkTypes;
|
||||
|
||||
|
|
@ -234,7 +234,7 @@ CurrencyInputComponent.propTypes = {
|
|||
|
||||
export const CurrencyInput = injectIntl(CurrencyInputComponent);
|
||||
|
||||
const CurrencyInputFieldComponent = props => {
|
||||
const FieldCurrencyInputComponent = props => {
|
||||
const { rootClassName, className, id, label, input, meta, ...rest } = props;
|
||||
|
||||
if (label && !id) {
|
||||
|
|
@ -263,14 +263,14 @@ const CurrencyInputFieldComponent = props => {
|
|||
);
|
||||
};
|
||||
|
||||
CurrencyInputFieldComponent.defaultProps = {
|
||||
FieldCurrencyInputComponent.defaultProps = {
|
||||
rootClassName: null,
|
||||
className: null,
|
||||
id: null,
|
||||
label: null,
|
||||
};
|
||||
|
||||
CurrencyInputFieldComponent.propTypes = {
|
||||
FieldCurrencyInputComponent.propTypes = {
|
||||
rootClassName: string,
|
||||
className: string,
|
||||
|
||||
|
|
@ -284,8 +284,8 @@ CurrencyInputFieldComponent.propTypes = {
|
|||
meta: object.isRequired,
|
||||
};
|
||||
|
||||
const CurrencyInputField = props => {
|
||||
return <Field component={CurrencyInputFieldComponent} {...props} />;
|
||||
const FieldCurrencyInput = props => {
|
||||
return <Field component={FieldCurrencyInputComponent} {...props} />;
|
||||
};
|
||||
|
||||
export default CurrencyInputField;
|
||||
export default FieldCurrencyInput;
|
||||
|
|
@ -9,7 +9,6 @@ export {
|
|||
InlineTextButton,
|
||||
} from './Button/Button';
|
||||
export { default as CookieConsent } from './CookieConsent/CookieConsent';
|
||||
export { default as CurrencyInputField } from './CurrencyInputField/CurrencyInputField';
|
||||
export { default as Discussion } from './Discussion/Discussion';
|
||||
export {
|
||||
default as EditListingDescriptionPanel,
|
||||
|
|
@ -30,6 +29,7 @@ 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 FieldCurrencyInput } from './FieldCurrencyInput/FieldCurrencyInput';
|
||||
export { default as FieldDateRangeInput } from './FieldDateRangeInput/FieldDateRangeInput';
|
||||
export { default as FieldGroupCheckbox } from './FieldGroupCheckbox/FieldGroupCheckbox';
|
||||
export { default as FieldReviewRating } from './FieldReviewRating/FieldReviewRating';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import classNames from 'classnames';
|
|||
import config from '../../config';
|
||||
import { propTypes } from '../../util/types';
|
||||
import { required } from '../../util/validators';
|
||||
import { Form, Button, CurrencyInputField } from '../../components';
|
||||
import { Form, Button, FieldCurrencyInput } from '../../components';
|
||||
|
||||
import css from './EditListingPricingForm.css';
|
||||
|
||||
|
|
@ -45,8 +45,8 @@ export const EditListingPricingFormComponent = props => {
|
|||
return (
|
||||
<Form className={classes} onSubmit={handleSubmit}>
|
||||
{errorMessage}
|
||||
<CurrencyInputField
|
||||
id="EditListingPricingForm.CurrencyInputField"
|
||||
<FieldCurrencyInput
|
||||
id="EditListingPricingForm.FieldCurrencyInput"
|
||||
className={css.priceInput}
|
||||
autoFocus
|
||||
name="price"
|
||||
|
|
|
|||
|
|
@ -11,14 +11,14 @@ exports[`EditListingPricingForm matches snapshot 1`] = `
|
|||
className=""
|
||||
>
|
||||
<label
|
||||
htmlFor="EditListingPricingForm.CurrencyInputField"
|
||||
htmlFor="EditListingPricingForm.FieldCurrencyInput"
|
||||
>
|
||||
EditListingPricingForm.pricePerUnit
|
||||
</label>
|
||||
<input
|
||||
autoFocus={true}
|
||||
className=""
|
||||
id="EditListingPricingForm.CurrencyInputField"
|
||||
id="EditListingPricingForm.FieldCurrencyInput"
|
||||
onBlur={[Function]}
|
||||
onChange={[Function]}
|
||||
onFocus={[Function]}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ import * as AddImages from './components/AddImages/AddImages.example';
|
|||
import * as Avatar from './components/Avatar/Avatar.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 FieldCurrencyInput from './components/FieldCurrencyInput/FieldCurrencyInput.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';
|
||||
|
|
@ -81,7 +81,6 @@ export {
|
|||
BookingDatesForm,
|
||||
Button,
|
||||
Colors,
|
||||
CurrencyInputField,
|
||||
EditListingDescriptionForm,
|
||||
EditListingFeaturesForm,
|
||||
EditListingLocationForm,
|
||||
|
|
@ -93,6 +92,7 @@ export {
|
|||
ExpandingTextarea,
|
||||
FieldBirthdayInput,
|
||||
FieldCheckbox,
|
||||
FieldCurrencyInput,
|
||||
FieldDateRangeInput,
|
||||
FieldGroupCheckbox,
|
||||
FieldReviewRating,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue