diff --git a/src/components/SearchFiltersMobile/SearchFiltersMobile.css b/src/components/SearchFiltersMobile/SearchFiltersMobile.css index 489d3152..25dcca21 100644 --- a/src/components/SearchFiltersMobile/SearchFiltersMobile.css +++ b/src/components/SearchFiltersMobile/SearchFiltersMobile.css @@ -66,12 +66,13 @@ .modalContainer { width: 100%; - padding: 94px 24px; + padding: 94px 0; } .modalHeadingWrapper { padding-bottom: 26px; border-bottom: 1px solid var(--matterColorNegative); + margin: 0 24px 30px 24px; } .modalHeading { @@ -99,3 +100,64 @@ color: var(--matterColor); } } + +.filterLabel { + @apply --marketplaceH3FontStyles; + color: var(--matterColorDark); + padding-left: 24px; +} + +.filterLabelSelected { + @apply --marketplaceH3FontStyles; + color: var(--marketplaceColor); + padding-left: 24px; +} + +/* left animated "border" like hover element */ +.optionBorder { + position: absolute; + top: 2px; + left: 0px; + height: calc(100% - 7px); + width: 0; + background-color: var(--matterColorDark); + transition: width var(--transitionStyleButton); +} + +/* left static border for selected element */ +.optionBorderSelected { + position: absolute; + top: 2px; + left: 0px; + height: calc(100% - 7px); + width: 12px; + background-color: var(--matterColorDark); + transition: width var(--transitionStyleButton); +} + +.option { + @apply --marketplaceH3FontStyles; + font-weight: var(--fontWeightMedium); + color: var(--matterColor); + + /* Layout */ + display: block; + position: relative; + margin: 0; + padding: 4px 24px 4px 44px; + + /* Override button styles */ + outline: none; + border: none; + + &:focus, + &:hover { + color: var(--matterColorDark); + } + + &:hover .menuItemBorder { + width: 6px; + } +} + + diff --git a/src/components/SearchFiltersMobile/SearchFiltersMobile.js b/src/components/SearchFiltersMobile/SearchFiltersMobile.js index 1a26512d..b46b5854 100644 --- a/src/components/SearchFiltersMobile/SearchFiltersMobile.js +++ b/src/components/SearchFiltersMobile/SearchFiltersMobile.js @@ -3,10 +3,63 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import { FormattedMessage, injectIntl, intlShape } from 'react-intl'; import { withRouter } from 'react-router-dom'; +import { omit } from 'lodash'; +import routeConfiguration from '../../routeConfiguration'; +import { createResourceLocatorString } from '../../util/routes'; import { SecondaryButton, ModalInMobile } from '../../components'; +import config from '../../config'; import css from './SearchFiltersMobile.css'; +class SelectSingleCustomAttributeMobile extends Component { + constructor(props) { + super(props); + this.selectOption = this.selectOption.bind(this); + } + + selectOption(option) { + const customAttribute = this.props.customAttribute; + console.log(`select option and ca: ${option} - ${customAttribute}`); + //this.setState({ isOpen: false }); + this.props.onSelect(customAttribute, option); + } + + render() { + const { customAttribute, urlQueryParams, intl } = this.props; + const filterLabel = intl.formatMessage({ + id: `SelectSingleCustomAttribute.${customAttribute}.label`, + }); + // custom attribute content + const ca = customAttribute && config.customAttributes[customAttribute]; + // name of the corresponding query parameter + const caParam = `ca_${customAttribute}`; + // current value of this custom attribute filter + const currentValue = urlQueryParams[caParam]; + + const labelClass = currentValue ? css.filterLabelSelected : css.filterLabel; + + return ( +