diff options
| author | Erik Larkö <erik@mullvad.net> | 2017-07-06 11:07:04 +0200 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-07-06 11:07:04 +0200 |
| commit | 02207abfbe8377a8a435da915426d5958a646413 (patch) | |
| tree | bd93f0b36094cc8b68a4cf1e3b0b136e3f114944 | |
| parent | 9ffcd12913f093e218996dd06e5e7513f2d12e07 (diff) | |
| parent | ec9e009405c655a7139ee2867f4971be87f88fef (diff) | |
| download | mullvadvpn-02207abfbe8377a8a435da915426d5958a646413.tar.xz mullvadvpn-02207abfbe8377a8a435da915426d5958a646413.zip | |
Merge branch 'map-on-linux'
| -rw-r--r-- | app/components/Connect.js | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/app/components/Connect.js b/app/components/Connect.js index 602ac5299e..8d5893c0a5 100644 --- a/app/components/Connect.js +++ b/app/components/Connect.js @@ -125,32 +125,35 @@ export default class Connect extends Component { const accountLocation = this.convertToMapCoordinate(this.props.account.location || [0, 0]); const serverLocation = this.convertToMapCoordinate(serverInfo.location); + const map = process.platform === 'darwin' + ? <ReactMapboxGl + style={ mapboxConfig.styleURL } + accessToken={ mapboxConfig.accessToken } + containerStyle={{ height: '100%' }} + interactive={ false } + fitBounds={ mapBounds } + fitBoundsOptions={ mapBoundsOptions }> + <If condition={ isConnected }> + <Then> + <Marker coordinates={ serverLocation } offset={ [0, -10] }> + <img src='./assets/images/location-marker-secure.svg' /> + </Marker> + </Then> + </If> + <If condition={ !isConnected }> + <Then> + <Marker coordinates={ accountLocation } offset={ [0, -10] }> + <img src='./assets/images/location-marker-unsecure.svg' /> + </Marker> + </Then> + </If> + </ReactMapboxGl> + : undefined; + return ( <div className="connect"> <div className="connect__map"> - <ReactMapboxGl - style={ mapboxConfig.styleURL } - accessToken={ mapboxConfig.accessToken } - containerStyle={{ height: '100%' }} - interactive={ false } - fitBounds={ mapBounds } - fitBoundsOptions={ mapBoundsOptions }> - <If condition={ isConnected }> - <Then> - <Marker coordinates={ serverLocation } offset={ [0, -10] }> - <img src='./assets/images/location-marker-secure.svg' /> - </Marker> - </Then> - </If> - <If condition={ !isConnected }> - <Then> - <Marker coordinates={ accountLocation } offset={ [0, -10] }> - <img src='./assets/images/location-marker-unsecure.svg' /> - </Marker> - </Then> - </If> - - </ReactMapboxGl> + { map } </div> <div className="connect__container"> |
