From e07027ce42bb0b7046b603aa35a1238694430ec6 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Mon, 15 Jan 2018 13:42:47 +0200 Subject: [PATCH] Rename SelectSingleCustomAttribute Rename SelectSingleCustomAttribute to SelectSingleFilter for more consistent naming with mobile components. --- src/components/SearchFilters/SearchFilters.js | 4 ++-- .../SelectSingleFilter.css} | 0 .../SelectSingleFilter.js} | 20 +++++++++---------- src/components/index.js | 4 +--- src/translations/en.json | 12 +++++------ 5 files changed, 19 insertions(+), 21 deletions(-) rename src/components/{SelectSingleCustomAttribute/SelectSingleCustomAttribute.css => SelectSingleFilter/SelectSingleFilter.css} (100%) rename src/components/{SelectSingleCustomAttribute/SelectSingleCustomAttribute.js => SelectSingleFilter/SelectSingleFilter.js} (80%) diff --git a/src/components/SearchFilters/SearchFilters.js b/src/components/SearchFilters/SearchFilters.js index 070ca134..d1e59f98 100644 --- a/src/components/SearchFilters/SearchFilters.js +++ b/src/components/SearchFilters/SearchFilters.js @@ -5,7 +5,7 @@ import classNames from 'classnames'; import { withRouter } from 'react-router-dom'; import { omit } from 'lodash'; -import { SelectSingleCustomAttribute } from '../../components'; +import { SelectSingleFilter } from '../../components'; import routeConfiguration from '../../routeConfiguration'; import { createResourceLocatorString } from '../../util/routes'; import config from '../../config'; @@ -49,7 +49,7 @@ const SearchFiltersComponent = props => { const hasCategoryConfig = config.customAttributes && config.customAttributes.category; const categoryFilter = hasCategoryConfig ? ( - this.selectOption(customAttribute, v)} > - + ); @@ -76,7 +76,7 @@ class SelectSingleCustomAttributeComponent extends Component { className={css.clearMenuItem} onClick={() => this.selectOption(customAttribute, null)} > - + @@ -87,12 +87,12 @@ class SelectSingleCustomAttributeComponent extends Component { const { object, string, func } = PropTypes; -SelectSingleCustomAttributeComponent.defaultProps = { +SelectSingleFilterComponent.defaultProps = { rootClassName: null, className: null, }; -SelectSingleCustomAttributeComponent.propTypes = { +SelectSingleFilterComponent.propTypes = { rootClassName: string, className: string, customAttribute: string.isRequired, @@ -103,6 +103,6 @@ SelectSingleCustomAttributeComponent.propTypes = { intl: intlShape.isRequired, }; -const SelectSingleCustomAttribute = injectIntl(SelectSingleCustomAttributeComponent); +const SelectSingleFilter = injectIntl(SelectSingleFilterComponent); -export default SelectSingleCustomAttribute; +export default SelectSingleFilter; diff --git a/src/components/index.js b/src/components/index.js index 90b69bfe..40164a57 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -99,9 +99,7 @@ export { default as SectionHero } from './SectionHero/SectionHero'; export { default as SectionHowItWorks } from './SectionHowItWorks/SectionHowItWorks'; export { default as SectionLocations } from './SectionLocations/SectionLocations'; export { default as SelectField } from './SelectField/SelectField'; -export { - default as SelectSingleCustomAttribute, -} from './SelectSingleCustomAttribute/SelectSingleCustomAttribute'; +export { default as SelectSingleFilter } from './SelectSingleFilter/SelectSingleFilter'; export { default as SelectSingleFilterMobile, } from './SelectSingleFilterMobile/SelectSingleFilterMobile'; diff --git a/src/translations/en.json b/src/translations/en.json index 1869fdca..f23de91e 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -498,12 +498,12 @@ "SectionLocations.listingsInLocation": "Saunas in {location}", "SectionLocations.subtitle": "We have more than 1000 saunas around Finland. Here are some of our most popular locations.", "SectionLocations.title": "We have wooden saunas, electric saunas, and even tent saunas.", - "SelectSingleCustomAttribute.category.label": "Category", - "SelectSingleCustomAttribute.category.option.mountain": "Mountain", - "SelectSingleCustomAttribute.category.option.other": "Other", - "SelectSingleCustomAttribute.category.option.road": "Road", - "SelectSingleCustomAttribute.category.option.track": "Track", - "SelectSingleCustomAttribute.clear": "Clear", + "SelectSingleFilter.category.label": "Category", + "SelectSingleFilter.category.option.mountain": "Mountain", + "SelectSingleFilter.category.option.other": "Other", + "SelectSingleFilter.category.option.road": "Road", + "SelectSingleFilter.category.option.track": "Track", + "SelectSingleFilter.clear": "Clear", "SelectSingleFilterMobile.category.label": "Category", "SelectSingleFilterMobile.category.option.mountain": "Mountain", "SelectSingleFilterMobile.category.option.other": "Other",