Sort merchants by country and city on component load
This commit is contained in:
parent
b782cfcd84
commit
23318a59e8
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,7 @@ import { FormattedMessage, FormattedHTMLMessage } from 'react-intl';
|
|||
import Modal from 'react-modal';
|
||||
import { Link } from 'react-router-dom';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import sortBy from 'sort-by';
|
||||
|
||||
// Custom components
|
||||
import AppHeader from '../AppHeader';
|
||||
|
@ -258,7 +259,7 @@ class MerchantsPage extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { data: merchantsData } = this.state.merchants;
|
||||
let { data: merchantsData } = this.state.merchants;
|
||||
const { ambassadorsMarkers, merchantsSearch } = this.state;
|
||||
|
||||
const merchantMarkers = merchantsSearch.map(merchant => {
|
||||
|
@ -276,6 +277,8 @@ class MerchantsPage extends Component {
|
|||
return marker;
|
||||
});
|
||||
|
||||
merchantsData = merchantsData.sort(sortBy('location.searchText'));
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
|
Loading…
Reference in a new issue