mobile open map modal button as sticky (not compatible: Edge < 16)

This commit is contained in:
Vesa Luusua 2017-08-22 14:20:23 +03:00
parent 417e72dff2
commit 9305aa76e1
4 changed files with 22 additions and 13 deletions

View file

@ -6,6 +6,7 @@
}
.listingCards {
flex-grow: 1;
padding: 0 24px 24px 24px;
@media (--viewportMedium) {

View file

@ -28,6 +28,7 @@ const SearchResultsPanel = props => {
currencyConfig={currencyConfig}
/>
))}
{props.children}
</div>
{paginationLinks}
</div>
@ -35,6 +36,7 @@ const SearchResultsPanel = props => {
};
SearchResultsPanel.defaultProps = {
children: null,
className: null,
listings: [],
pagination: null,
@ -42,9 +44,10 @@ SearchResultsPanel.defaultProps = {
search: null,
};
const { array, object, string } = PropTypes;
const { array, node, object, string } = PropTypes;
SearchResultsPanel.propTypes = {
children: node,
className: string,
currencyConfig: propTypes.currencyConfig.isRequired,
listings: array,

View file

@ -117,6 +117,10 @@
}
}
.openMobileMapSticky {
position: sticky;
}
.mapPanel {
@media (--viewportMedium) {

View file

@ -254,19 +254,20 @@ export class SearchPageComponent extends Component {
listings={listings}
pagination={listingsAreLoaded ? pagination : null}
search={searchParamsForPagination}
/>
>
<button
className={classNames(css.openMobileMap, { [css.openMobileMapSticky] : listings.length > 0 })}
onClick={() => {
this.useLocationSearchBounds = true;
this.modalOpenedBoundsChange = true;
this.setState({ isSearchMapOpenOnMobile: true });
}}
>
<MapIcon className={css.openMobileMapIcon} />
<FormattedMessage id="SearchPage.openMapView" />
</button>
</SearchResultsPanel>
</div>
<button
className={css.openMobileMap}
onClick={() => {
this.useLocationSearchBounds = true;
this.modalOpenedBoundsChange = true;
this.setState({ isSearchMapOpenOnMobile: true });
}}
>
<MapIcon className={css.openMobileMapIcon} />
<FormattedMessage id="SearchPage.openMapView" />
</button>
</div>
<ModalInMobile
className={css.mapPanel}