Skip to content

Commit

Permalink
Update locations map to render fake data
Browse files Browse the repository at this point in the history
  • Loading branch information
Initsogar committed Jan 16, 2025
1 parent 5ca40dd commit 2aaec76
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ const StatsLocations: React.FC< StatsModuleLocationsProps > = ( { query, summary
];
const hasLocationData = Array.isArray( data ) && data.length > 0;

const locationData = shouldGate ? fakeData : data;

return (
<>
{ ! shouldGateStatsModule && siteId && statType && (
Expand Down Expand Up @@ -188,20 +190,20 @@ const StatsLocations: React.FC< StatsModuleLocationsProps > = ( { query, summary
</StatsInfoArea>
}
moduleType="countryviews"
data={ shouldGate ? fakeData : data }
data={ locationData }
emptyMessage={ emptyMessage }
metricLabel={ translate( 'Views' ) }
loader={ isRequestingData && <StatsModulePlaceholder isLoading={ isRequestingData } /> }
splitHeader
heroElement={ <Geochart data={ data } geoMode={ geoMode } skipQuery /> }
heroElement={ <Geochart data={ locationData } geoMode={ geoMode } skipQuery /> }
mainItemLabel={ optionLabels[ selectedOption ]?.headerLabel }
toggleControl={ toggleControlComponent }
showMore={
summaryUrl
? {
url: summaryUrl,
label:
Array.isArray( data ) && data.length >= 10
Array.isArray( locationData ) && locationData.length >= 10
? translate( 'View all', {
context: 'Stats: Button link to show more detailed stats information',
} )
Expand Down

0 comments on commit 2aaec76

Please sign in to comment.