Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # yarn.lockpull/580/head
commit
f9bf6aff2e
|
@ -4,17 +4,14 @@ import ReactTooltip from 'react-tooltip';
|
||||||
import { ComposableMap, Geographies, Geography, ZoomableGroup } from 'react-simple-maps';
|
import { ComposableMap, Geographies, Geography, ZoomableGroup } from 'react-simple-maps';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import tinycolor from 'tinycolor2';
|
import tinycolor from 'tinycolor2';
|
||||||
|
import Datamap from 'datamaps';
|
||||||
import useTheme from 'hooks/useTheme';
|
import useTheme from 'hooks/useTheme';
|
||||||
import { THEME_COLORS } from 'lib/constants';
|
import { THEME_COLORS } from 'lib/constants';
|
||||||
import styles from './WorldMap.module.css';
|
import styles from './WorldMap.module.css';
|
||||||
import useCountryNames from 'hooks/useCountryNames';
|
import useCountryNames from 'hooks/useCountryNames';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import { useRouter } from 'next/router';
|
|
||||||
|
|
||||||
const geoUrl = '/world-110m.json';
|
|
||||||
|
|
||||||
function WorldMap({ data, className }) {
|
function WorldMap({ data, className }) {
|
||||||
const { basePath } = useRouter();
|
|
||||||
const [tooltip, setTooltip] = useState();
|
const [tooltip, setTooltip] = useState();
|
||||||
const [theme] = useTheme();
|
const [theme] = useTheme();
|
||||||
const colors = useMemo(
|
const colors = useMemo(
|
||||||
|
@ -60,7 +57,7 @@ function WorldMap({ data, className }) {
|
||||||
>
|
>
|
||||||
<ComposableMap projection="geoMercator">
|
<ComposableMap projection="geoMercator">
|
||||||
<ZoomableGroup zoom={0.8} minZoom={0.7} center={[0, 40]}>
|
<ZoomableGroup zoom={0.8} minZoom={0.7} center={[0, 40]}>
|
||||||
<Geographies geography={`${basePath}${geoUrl}`}>
|
<Geographies geography={Datamap.prototype.worldTopo}>
|
||||||
{({ geographies }) => {
|
{({ geographies }) => {
|
||||||
return geographies.map(geo => {
|
return geographies.map(geo => {
|
||||||
const code = geo.properties.ISO_A2;
|
const code = geo.properties.ISO_A2;
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"cookie": "^0.4.1",
|
"cookie": "^0.4.1",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
"datamaps": "^0.5.9",
|
||||||
"date-fns": "^2.16.1",
|
"date-fns": "^2.16.1",
|
||||||
"date-fns-tz": "^1.0.12",
|
"date-fns-tz": "^1.0.12",
|
||||||
"detect-browser": "^5.2.0",
|
"detect-browser": "^5.2.0",
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -109,6 +109,7 @@ function mockPageView(
|
||||||
hostname: 'localhost',
|
hostname: 'localhost',
|
||||||
screen: '1680x1050',
|
screen: '1680x1050',
|
||||||
url: '/LOADTESTING',
|
url: '/LOADTESTING',
|
||||||
|
referrer: 'https://www.prisma.io',
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue