mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Use a div instead of button around the dynamic map
This commit is contained in:
parent
6e339b86f6
commit
c4dfa7d4c3
1 changed files with 13 additions and 8 deletions
|
|
@ -28,20 +28,25 @@ class SectionMapMaybe extends Component {
|
|||
const mapProps = config.coordinates.fuzzy
|
||||
? { obfuscatedCenter: obfuscatedCoordinates(geolocation, listingId ? listingId.uuid : null) }
|
||||
: { address, center: geolocation };
|
||||
const map = <Map {...mapProps} useStaticMap={this.state.isStatic} />;
|
||||
|
||||
return (
|
||||
<div className={classes}>
|
||||
<h2 className={css.locationTitle}>
|
||||
<FormattedMessage id="ListingPage.locationTitle" />
|
||||
</h2>
|
||||
<button
|
||||
className={css.map}
|
||||
onClick={() => {
|
||||
this.setState({ isStatic: false });
|
||||
}}
|
||||
>
|
||||
<Map {...mapProps} useStaticMap={this.state.isStatic} />
|
||||
</button>
|
||||
{this.state.isStatic ? (
|
||||
<button
|
||||
className={css.map}
|
||||
onClick={() => {
|
||||
this.setState({ isStatic: false });
|
||||
}}
|
||||
>
|
||||
{map}
|
||||
</button>
|
||||
) : (
|
||||
<div className={css.map}>{map}</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue