Replace city and country by sortable location

This commit is contained in:
Letícia Camara 2018-10-31 19:53:04 -03:00
parent 3b4593540f
commit 57a63fa711
2 changed files with 6 additions and 3 deletions

View file

@ -394,7 +394,7 @@ class AmbassadorsPage extends Component {
<EnhancedTable <EnhancedTable
columnData={columnData} columnData={columnData}
data={data} data={data}
orderBy="nickname" orderBy="location"
showSearchColumns={false} showSearchColumns={false}
rowsPerPage={10} rowsPerPage={10}
isAdmin={false} isAdmin={false}

View file

@ -54,8 +54,7 @@ const mapsStyles = {
const columnData = [ const columnData = [
{ id: 'name', numeric: false, disablePadding: true, label: 'Name' }, { id: 'name', numeric: false, disablePadding: true, label: 'Name' },
{ id: 'address', numeric: false, disablePadding: true, label: 'Address' }, { id: 'address', numeric: false, disablePadding: true, label: 'Address' },
{ id: 'city', numeric: false, disablePadding: false, label: 'City' }, { id: 'location', numeric: false, disablePadding: false, label: 'Location' },
{ id: 'country', numeric: false, disablePadding: false, label: 'Country' },
{ id: 'map', numeric: false, disablePadding: false, label: 'Maps', disableSearch: true} { id: 'map', numeric: false, disablePadding: false, label: 'Maps', disableSearch: true}
]; ];
@ -203,6 +202,10 @@ class MerchantsPage extends Component {
<div><b>Address</b>: {merchant.address}</div> <div><b>Address</b>: {merchant.address}</div>
{(merchant.phone) && (<div><b>Phone</b>: {merchant.phone}</div>)} {(merchant.phone) && (<div><b>Phone</b>: {merchant.phone}</div>)}
</div>; </div>;
merchant.location = {
searchText: `${merchant.country} - ${merchant.city}`,
value: (merchant.city) ? `${merchant.city} - ${merchant.country}`: merchant.country
}
merchant.map = <Button merchant.map = <Button
className="App-button" className="App-button"
variant="contained" variant="contained"