summaryrefslogtreecommitdiffhomepage
path: root/app/containers
diff options
context:
space:
mode:
authoranderklander <anderklander@gmail.com>2017-11-09 13:30:52 +0100
committerErik Larkö <erik@mullvad.net>2017-12-14 09:16:49 +0100
commita35898e0fafa2dae93b00ca074b810cc88a2fa71 (patch)
tree8b85b8bbff5085e4a121e5d06af31271132ac2f0 /app/containers
parentb74910f21f720741a6b7e3e537ee637200e6a449 (diff)
downloadmullvadvpn-a35898e0fafa2dae93b00ca074b810cc88a2fa71.tar.xz
mullvadvpn-a35898e0fafa2dae93b00ca074b810cc88a2fa71.zip
Reactxp starter pack
Some changes in app init and rendering the header bar in reactxp. Moved linking and exit to separate files for web/mobile
Diffstat (limited to 'app/containers')
-rw-r--r--app/containers/AccountPage.js4
-rw-r--r--app/containers/ConnectPage.js4
-rw-r--r--app/containers/LoginPage.js6
-rw-r--r--app/containers/SettingsPage.js8
4 files changed, 14 insertions, 8 deletions
diff --git a/app/containers/AccountPage.js b/app/containers/AccountPage.js
index f5d31e5bc0..ae992bc12a 100644
--- a/app/containers/AccountPage.js
+++ b/app/containers/AccountPage.js
@@ -5,8 +5,8 @@ import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
import Account from '../components/Account';
import accountActions from '../redux/account/actions';
-import { shell } from 'electron';
import { links } from '../config';
+import Linking from '../lib/linking';
import type { ReduxState, ReduxDispatch } from '../redux/store';
import type { SharedRouteProps } from '../routes';
@@ -22,7 +22,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) =>
onClose: () => {
pushHistory('/settings');
},
- onBuyMore: () => shell.openExternal(links['purchase'])
+ onBuyMore: () => Linking(links['purchase'])
};
};
diff --git a/app/containers/ConnectPage.js b/app/containers/ConnectPage.js
index ca64c6725a..1694e84556 100644
--- a/app/containers/ConnectPage.js
+++ b/app/containers/ConnectPage.js
@@ -3,10 +3,10 @@
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
-import { shell } from 'electron';
import { links } from '../config';
import Connect from '../components/Connect';
import connectActions from '../redux/connection/actions';
+import Linking from '../lib/linking';
import type { ReduxState, ReduxDispatch } from '../redux/store';
import type { SharedRouteProps } from '../routes';
@@ -40,7 +40,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) =>
onDisconnect: () => {
disconnect(backend);
},
- onExternalLink: (type) => shell.openExternal(links[type]),
+ onExternalLink: (type) => Linking(links[type]),
getServerInfo: (relayLocation) => backend.serverInfo(relayLocation),
};
};
diff --git a/app/containers/LoginPage.js b/app/containers/LoginPage.js
index c6c7d3a7e2..16703fdc0c 100644
--- a/app/containers/LoginPage.js
+++ b/app/containers/LoginPage.js
@@ -1,12 +1,16 @@
+<<<<<<< HEAD
// @flow
import { shell } from 'electron';
+=======
+>>>>>>> Reactxp starter pack
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
import Login from '../components/Login';
import accountActions from '../redux/account/actions';
import { links } from '../config';
+import Linking from '../lib/linking';
import type { ReduxState, ReduxDispatch } from '../redux/store';
import type { SharedRouteProps } from '../routes';
@@ -26,7 +30,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) =>
onFirstChangeAfterFailure: () => {
resetLoginError();
},
- onExternalLink: (type) => shell.openExternal(links[type]),
+ onExternalLink: (type) => Linking(links[type]),
onAccountTokenChange: (token) => {
updateAccountToken(token);
},
diff --git a/app/containers/SettingsPage.js b/app/containers/SettingsPage.js
index dcd1d121bb..8d41efd4d9 100644
--- a/app/containers/SettingsPage.js
+++ b/app/containers/SettingsPage.js
@@ -4,8 +4,10 @@ import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
import Settings from '../components/Settings';
-import { remote, shell } from 'electron';
+import settingsActions from '../redux/settings/actions';
import { links } from '../config';
+import Linking from '../lib/linking';
+import Exit from '../lib/exit';
import type { ReduxState, ReduxDispatch } from '../redux/store';
import type { SharedRouteProps } from '../routes';
@@ -14,12 +16,12 @@ const mapStateToProps = (state: ReduxState) => state;
const mapDispatchToProps = (dispatch: ReduxDispatch, _props: SharedRouteProps) => {
const { push: pushHistory } = bindActionCreators({ push }, dispatch);
return {
- onQuit: () => remote.app.quit(),
+ onQuit: () => Exit(),
onClose: () => pushHistory('/connect'),
onViewAccount: () => pushHistory('/settings/account'),
onViewSupport: () => pushHistory('/settings/support'),
onViewAdvancedSettings: () => pushHistory('/settings/advanced'),
- onExternalLink: (type) => shell.openExternal(links[type]),
+ onExternalLink: (type) => Linking(links[type]),
};
};