Add complete info for merchant pin at "show on map"
This commit is contained in:
parent
30322961de
commit
23e47a73ab
1 changed files with 28 additions and 29 deletions
|
@ -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
|
||||
</Button>;
|
||||
return merchant;
|
||||
|
@ -378,25 +373,17 @@ 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 => {
|
||||
getMerchantMarker = (merchant) => {
|
||||
const infoDescription = <div>
|
||||
<div><b>Address</b>: {merchant.address}</div>
|
||||
{(merchant.phone) && (<div><b>Phone</b>: {merchant.phone}</div>)}
|
||||
|
@ -418,6 +405,18 @@ class MerchantsPage extends Component {
|
|||
infoDescription: infoDescription,
|
||||
};
|
||||
return marker;
|
||||
};
|
||||
|
||||
handleSearchChange(data){
|
||||
this.setState({ merchantsSearch: data });
|
||||
}
|
||||
|
||||
render() {
|
||||
let { data: merchantsData } = this.state.merchants;
|
||||
const { ambassadorsMarkers, merchantsSearch } = this.state;
|
||||
|
||||
const merchantMarkers = merchantsSearch.map(merchant => {
|
||||
return this.getMerchantMarker(merchant);
|
||||
});
|
||||
|
||||
merchantsData = merchantsData.sort(sortBy('location.searchText'));
|
||||
|
|
Loading…
Reference in a new issue