diff --git a/src/components/pages/MerchantsPage.js b/src/components/pages/MerchantsPage.js index 5cf5795..2cf1f6e 100644 --- a/src/components/pages/MerchantsPage.js +++ b/src/components/pages/MerchantsPage.js @@ -348,12 +348,7 @@ class MerchantsPage extends Component { color: 'white', whiteSpace: 'nowrap' }} - onClick={() => this.openMaps( - merchant.name, - infoDescription, - merchant.lat, - merchant.lon - )} + onClick={() => this.openMaps(merchant.name, app.getMerchantMarker(merchant))} >Show on Map ; return merchant; @@ -378,26 +373,18 @@ class MerchantsPage extends Component { }); } - openMaps(name, address, lat, lon){ + openMaps(name, marker){ this.setState({ mapsTitle: name, - mapsDescription: address, - mapsLat: lat, - mapsLon: lon, + mapsDescription: marker.infoDescription, + mapsLat: marker.lat, + mapsLon: marker.lng, mapsModalIsOpen: true }); } - handleSearchChange(data){ - this.setState({ merchantsSearch: data }); - } - - render() { - let { data: merchantsData } = this.state.merchants; - const { ambassadorsMarkers, merchantsSearch } = this.state; - - const merchantMarkers = merchantsSearch.map(merchant => { - const infoDescription =