Merge pull request #644 from sharetribe/rename-select-custom-attribute

Rename SelectSingleCustomAttribute
This commit is contained in:
Hannu Lyytikäinen 2018-01-15 13:58:34 +02:00 committed by GitHub
commit a53574f35e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 21 deletions

View file

@ -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 ? (
<SelectSingleCustomAttribute
<SelectSingleFilter
customAttribute="category"
urlQueryParams={urlQueryParams}
onSelect={onSelectSingle}

View file

@ -5,9 +5,9 @@ import classNames from 'classnames';
import config from '../../config';
import { Menu, MenuContent, MenuItem, MenuLabel } from '../../components';
import css from './SelectSingleCustomAttribute.css';
import css from './SelectSingleFilter.css';
class SelectSingleCustomAttributeComponent extends Component {
class SelectSingleFilterComponent extends Component {
constructor(props) {
super(props);
@ -37,8 +37,8 @@ class SelectSingleCustomAttributeComponent extends Component {
// resolve menu label text and class
const menuLabel = currentValue
? intl.formatMessage({ id: `SelectSingleCustomAttribute.category.option.${currentValue}` })
: intl.formatMessage({ id: `SelectSingleCustomAttribute.${customAttribute}.label` });
? intl.formatMessage({ id: `SelectSingleFilter.category.option.${currentValue}` })
: intl.formatMessage({ id: `SelectSingleFilter.${customAttribute}.label` });
const menuLabelClass = currentValue ? css.menuLabelSelected : css.menuLabel;
const classes = classNames(rootClassName || css.root, className);
@ -66,7 +66,7 @@ class SelectSingleCustomAttributeComponent extends Component {
onClick={() => this.selectOption(customAttribute, v)}
>
<span className={menuItemBorderClass} />
<FormattedMessage id={`SelectSingleCustomAttribute.category.option.${v}`} />
<FormattedMessage id={`SelectSingleFilter.category.option.${v}`} />
</button>
</MenuItem>
);
@ -76,7 +76,7 @@ class SelectSingleCustomAttributeComponent extends Component {
className={css.clearMenuItem}
onClick={() => this.selectOption(customAttribute, null)}
>
<FormattedMessage id={'SelectSingleCustomAttribute.clear'} />
<FormattedMessage id={'SelectSingleFilter.clear'} />
</button>
</MenuItem>
</MenuContent>
@ -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;

View file

@ -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';

View file

@ -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",