mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 17:40:23 +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(
|
const { os, browsers, referrers, countries, cities, citiesForMap } = processStatsFromVisits(
|
||||||
{ id: this.memoizationId, visits }
|
{ id: this.memoizationId, visits }
|
||||||
);
|
);
|
||||||
|
const mapLocations = values(citiesForMap);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="row">
|
<div className="row">
|
||||||
|
@ -109,14 +110,9 @@ const ShortUrlVisits = ({ processStatsFromVisits }) => class ShortUrlVisits exte
|
||||||
<SortableBarGraph
|
<SortableBarGraph
|
||||||
stats={cities}
|
stats={cities}
|
||||||
title="Cities"
|
title="Cities"
|
||||||
extraHeaderContent={[
|
extraHeaderContent={
|
||||||
() => (
|
[ () => mapLocations.length > 0 && <OpenMapModalBtn modalTitle="Cities" locations={mapLocations} /> ]
|
||||||
<OpenMapModalBtn
|
}
|
||||||
modalTitle="Cities"
|
|
||||||
locations={values(citiesForMap)}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
]}
|
|
||||||
sortingItems={{
|
sortingItems={{
|
||||||
name: 'City name',
|
name: 'City name',
|
||||||
amount: 'Visits amount',
|
amount: 'Visits amount',
|
||||||
|
|
Loading…
Reference in a new issue