mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 09:30:31 +03:00
Ensured maps modal btn is not rendered when the number of located cities is 0
This commit is contained in:
parent
701c143149
commit
87a4598391
1 changed files with 4 additions and 8 deletions
|
@ -76,6 +76,7 @@ const ShortUrlVisits = ({ processStatsFromVisits }) => class ShortUrlVisits exte
|
|||
const { os, browsers, referrers, countries, cities, citiesForMap } = processStatsFromVisits(
|
||||
{ id: this.memoizationId, visits }
|
||||
);
|
||||
const mapLocations = values(citiesForMap);
|
||||
|
||||
return (
|
||||
<div className="row">
|
||||
|
@ -109,14 +110,9 @@ const ShortUrlVisits = ({ processStatsFromVisits }) => class ShortUrlVisits exte
|
|||
<SortableBarGraph
|
||||
stats={cities}
|
||||
title="Cities"
|
||||
extraHeaderContent={[
|
||||
() => (
|
||||
<OpenMapModalBtn
|
||||
modalTitle="Cities"
|
||||
locations={values(citiesForMap)}
|
||||
/>
|
||||
),
|
||||
]}
|
||||
extraHeaderContent={
|
||||
[ () => mapLocations.length > 0 && <OpenMapModalBtn modalTitle="Cities" locations={mapLocations} /> ]
|
||||
}
|
||||
sortingItems={{
|
||||
name: 'City name',
|
||||
amount: 'Visits amount',
|
||||
|
|
Loading…
Reference in a new issue