mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
mobile open map modal button as sticky (not compatible: Edge < 16)
This commit is contained in:
parent
417e72dff2
commit
9305aa76e1
4 changed files with 22 additions and 13 deletions
|
|
@ -6,6 +6,7 @@
|
|||
}
|
||||
|
||||
.listingCards {
|
||||
flex-grow: 1;
|
||||
padding: 0 24px 24px 24px;
|
||||
|
||||
@media (--viewportMedium) {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -117,6 +117,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
.openMobileMapSticky {
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
.mapPanel {
|
||||
|
||||
@media (--viewportMedium) {
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue