mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-27 19:42:11 +10:00
Change component names
This commit is contained in:
parent
c7f5afd82b
commit
afe9cad777
2 changed files with 9 additions and 9 deletions
|
|
@ -4,10 +4,10 @@ import { withGoogleMap, GoogleMap, Marker, Circle } from 'react-google-maps';
|
|||
import config from '../../config';
|
||||
|
||||
/**
|
||||
* DynamicMap uses withGoogleMap HOC.
|
||||
* DynamicGoogleMap uses withGoogleMap HOC.
|
||||
* It handles some of the google map initialization states.
|
||||
*/
|
||||
const DynamicMap = withGoogleMap(props => {
|
||||
const DynamicGoogleMap = withGoogleMap(props => {
|
||||
const { center, zoom, address, coordinatesConfig } = props;
|
||||
|
||||
const { markerURI, anchorX, anchorY, width, height } = coordinatesConfig.customMarker || {};
|
||||
|
|
@ -53,14 +53,14 @@ const DynamicMap = withGoogleMap(props => {
|
|||
);
|
||||
});
|
||||
|
||||
DynamicMap.defaultProps = {
|
||||
DynamicGoogleMap.defaultProps = {
|
||||
address: '',
|
||||
center: null,
|
||||
zoom: config.coordinates.fuzzy ? config.coordinates.fuzzyDefaultZoomLevel : 11,
|
||||
coordinatesConfig: config.coordinates,
|
||||
};
|
||||
|
||||
DynamicMap.propTypes = {
|
||||
DynamicGoogleMap.propTypes = {
|
||||
address: string,
|
||||
center: shape({
|
||||
lat: number.isRequired,
|
||||
|
|
@ -70,4 +70,4 @@ DynamicMap.propTypes = {
|
|||
coordinatesConfig: object,
|
||||
};
|
||||
|
||||
export default DynamicMap;
|
||||
export default DynamicGoogleMap;
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ const customMarker = (options, lat, lng) => {
|
|||
return [`anchor:${anchorX},${anchorY}`, `icon:${markerURI}`, `${lat},${lng}`].join('|');
|
||||
};
|
||||
|
||||
class StaticMap extends Component {
|
||||
class StaticGoogleMap extends Component {
|
||||
shouldComponentUpdate(nextProps, prevState) {
|
||||
// Do not draw the map unless center, zoom or dimensions change
|
||||
// We want to prevent unnecessary calls to Google Maps APIs due
|
||||
|
|
@ -147,7 +147,7 @@ class StaticMap extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
StaticMap.defaultProps = {
|
||||
StaticGoogleMap.defaultProps = {
|
||||
className: null,
|
||||
rootClassName: null,
|
||||
address: '',
|
||||
|
|
@ -156,7 +156,7 @@ StaticMap.defaultProps = {
|
|||
coordinatesConfig: config.coordinates,
|
||||
};
|
||||
|
||||
StaticMap.propTypes = {
|
||||
StaticGoogleMap.propTypes = {
|
||||
className: string,
|
||||
rootClassName: string,
|
||||
address: string,
|
||||
|
|
@ -174,4 +174,4 @@ StaticMap.propTypes = {
|
|||
}).isRequired,
|
||||
};
|
||||
|
||||
export default lazyLoadWithDimensions(StaticMap, { maxWidth: '640px' });
|
||||
export default lazyLoadWithDimensions(StaticGoogleMap, { maxWidth: '640px' });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue