mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Merge pull request #881 from sharetribe/fix-production-rendering-vol2
Fix: render only when mountNode is present
This commit is contained in:
commit
11f8696745
5 changed files with 28 additions and 32 deletions
|
|
@ -11,6 +11,10 @@ way to update this template, but currently, we follow a pattern:
|
|||
* Patch (v0.0.**X**): Bug fixes and small changes to components.
|
||||
|
||||
---
|
||||
## v1.3.1
|
||||
* [fix] Hotfix: reverting the usage of ReusableMapContainer due to
|
||||
production build error.
|
||||
[#881](https://github.com/sharetribe/flex-template-web/pull/881)
|
||||
|
||||
## v1.3.0
|
||||
* [change] Reusable SearchMap.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "app",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import { googleBoundsToSDKBounds } from '../../util/googleMaps';
|
|||
import { SearchMapInfoCard, SearchMapPriceLabel, SearchMapGroupLabel } from '../../components';
|
||||
import config from '../../config';
|
||||
|
||||
import ReusableMapContainer from './ReusableMapContainer';
|
||||
import css from './SearchMap.css';
|
||||
|
||||
const LABEL_HANDLE = 'SearchMapLabel';
|
||||
|
|
@ -241,7 +240,6 @@ export class SearchMapComponent extends Component {
|
|||
const {
|
||||
className,
|
||||
rootClassName,
|
||||
reuseableContainerClassName,
|
||||
center,
|
||||
isOpenOnModal,
|
||||
listings: originalListings,
|
||||
|
|
@ -265,30 +263,28 @@ export class SearchMapComponent extends Component {
|
|||
// container element listens clicks so that opened SearchMapInfoCard can be closed
|
||||
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
||||
return isMapsLibLoaded ? (
|
||||
<ReusableMapContainer className={reuseableContainerClassName}>
|
||||
<MapWithGoogleMap
|
||||
containerElement={<div className={classes} onClick={this.onMapClicked} />}
|
||||
mapElement={<div className={mapClasses} />}
|
||||
center={center}
|
||||
isOpenOnModal={isOpenOnModal}
|
||||
listings={listings}
|
||||
activeListingId={activeListingId}
|
||||
infoCardOpen={this.state.infoCardOpen}
|
||||
onListingClicked={this.onListingClicked}
|
||||
onMapLoad={this.onMapLoadHandler}
|
||||
onIdle={() => {
|
||||
if (this.googleMap) {
|
||||
onIdle(this.googleMap);
|
||||
}
|
||||
}}
|
||||
onCloseAsModal={() => {
|
||||
if (onCloseAsModal) {
|
||||
onCloseAsModal();
|
||||
}
|
||||
}}
|
||||
zoom={zoom}
|
||||
/>
|
||||
</ReusableMapContainer>
|
||||
<MapWithGoogleMap
|
||||
containerElement={<div className={classes} onClick={this.onMapClicked} />}
|
||||
mapElement={<div className={mapClasses} />}
|
||||
center={center}
|
||||
isOpenOnModal={isOpenOnModal}
|
||||
listings={listings}
|
||||
activeListingId={activeListingId}
|
||||
infoCardOpen={this.state.infoCardOpen}
|
||||
onListingClicked={this.onListingClicked}
|
||||
onMapLoad={this.onMapLoadHandler}
|
||||
onIdle={() => {
|
||||
if (this.googleMap) {
|
||||
onIdle(this.googleMap);
|
||||
}
|
||||
}}
|
||||
onCloseAsModal={() => {
|
||||
if (onCloseAsModal) {
|
||||
onCloseAsModal();
|
||||
}
|
||||
}}
|
||||
zoom={zoom}
|
||||
/>
|
||||
) : (
|
||||
<div className={classes} />
|
||||
);
|
||||
|
|
@ -300,7 +296,6 @@ SearchMapComponent.defaultProps = {
|
|||
className: null,
|
||||
rootClassName: null,
|
||||
mapRootClassName: null,
|
||||
reuseableContainerClassName: null,
|
||||
bounds: null,
|
||||
center: new sdkTypes.LatLng(0, 0),
|
||||
activeListingId: null,
|
||||
|
|
@ -316,7 +311,6 @@ SearchMapComponent.propTypes = {
|
|||
className: string,
|
||||
rootClassName: string,
|
||||
mapRootClassName: string,
|
||||
reuseableContainerClassName: string,
|
||||
bounds: propTypes.latlngBounds,
|
||||
center: propTypes.latlng,
|
||||
activeListingId: propTypes.uuid,
|
||||
|
|
|
|||
|
|
@ -251,10 +251,9 @@ export class SearchPageComponent extends Component {
|
|||
showAsModalMaxWidth={MODAL_BREAKPOINT}
|
||||
onManageDisableScrolling={onManageDisableScrolling}
|
||||
>
|
||||
<div className={css.mapWrapper}>
|
||||
<div className={css.map}>
|
||||
{shouldShowSearchMap ? (
|
||||
<SearchMap
|
||||
reuseableContainerClassName={css.map}
|
||||
activeListingId={activeListingId}
|
||||
bounds={bounds}
|
||||
center={origin}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ exports[`SearchPageComponent matches snapshot 1`] = `
|
|||
mapRootClassName={null}
|
||||
onCloseAsModal={[Function]}
|
||||
onIdle={[Function]}
|
||||
reuseableContainerClassName={null}
|
||||
rootClassName={null}
|
||||
useLocationSearchBounds={true}
|
||||
zoom={11}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue