summaryrefslogtreecommitdiffhomepage
path: root/app/components/Map.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-02-21 10:45:11 +0100
committerAndrej Mihajlov <and@mullvad.net>2018-02-21 10:45:11 +0100
commitde737c54c413f96c35b4e9bc6280fc7d26e4fa83 (patch)
tree0cf470c59b4c7c8a6327e64610f68f5facd78d6d /app/components/Map.js
parentae9c255b3ecdec341090c932db6cb261147a7382 (diff)
parent1214138633bcca19a1b96622400f3fbcf4044bd9 (diff)
downloadmullvadvpn-de737c54c413f96c35b4e9bc6280fc7d26e4fa83.tar.xz
mullvadvpn-de737c54c413f96c35b4e9bc6280fc7d26e4fa83.zip
Merge branch 'update-flow'
Diffstat (limited to 'app/components/Map.js')
-rw-r--r--app/components/Map.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/components/Map.js b/app/components/Map.js
index d416b77961..3865e8975a 100644
--- a/app/components/Map.js
+++ b/app/components/Map.js
@@ -1,6 +1,6 @@
// @flow
-import React from 'react';
+import * as React from 'react';
import { Component, View } from 'reactxp';
import SvgMap from './SvgMap';
@@ -21,11 +21,8 @@ type MapState = {
}
};
-export default class Map extends Component {
-
- props: MapProps;
-
- state: MapState = {
+export default class Map extends Component<MapProps, MapState> {
+ state = {
bounds: {
width: 0,
height: 0,
@@ -84,6 +81,8 @@ export default class Map extends Component {
case 'high': return 1;
case 'medium': return 20;
case 'low': return 40;
+ default:
+ throw new Error(`Invalid enumeration type: ${variant}`);
}
}
@@ -93,6 +92,8 @@ export default class Map extends Component {
return './assets/images/location-marker-secure.svg';
case 'unsecure':
return './assets/images/location-marker-unsecure.svg';
+ default:
+ throw new Error(`Invalid enumeration type: ${style}`);
}
}