summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/containers
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-07-22 14:43:17 +0200
committerOskar Nyberg <oskar@mullvad.net>2021-07-22 14:43:17 +0200
commitf8e47dc57b4821e119104ba1c1223e32085d7174 (patch)
tree365c04dad43d9de5b6f669e2d5bbf22e48a8b0b8 /gui/src/renderer/containers
parent43a5f956fbc8fc137367fb6676c7c34d3e8f93cf (diff)
parentbefbb4b3aee6b96eb248cdc883a4f42d3901bacc (diff)
downloadmullvadvpn-f8e47dc57b4821e119104ba1c1223e32085d7174.tar.xz
mullvadvpn-f8e47dc57b4821e119104ba1c1223e32085d7174.zip
Merge branch 'add-routes-enum'
Diffstat (limited to 'gui/src/renderer/containers')
-rw-r--r--gui/src/renderer/containers/AdvancedSettingsPage.tsx5
-rw-r--r--gui/src/renderer/containers/ConnectPage.tsx3
-rw-r--r--gui/src/renderer/containers/ExpiredAccountErrorViewContainer.tsx3
-rw-r--r--gui/src/renderer/containers/SettingsPage.tsx11
4 files changed, 13 insertions, 9 deletions
diff --git a/gui/src/renderer/containers/AdvancedSettingsPage.tsx b/gui/src/renderer/containers/AdvancedSettingsPage.tsx
index 36a1a77963..d16f193ce0 100644
--- a/gui/src/renderer/containers/AdvancedSettingsPage.tsx
+++ b/gui/src/renderer/containers/AdvancedSettingsPage.tsx
@@ -11,6 +11,7 @@ import AdvancedSettings from '../components/AdvancedSettings';
import withAppContext, { IAppContext } from '../context';
import { IHistoryProps, withHistory } from '../lib/history';
+import { RoutePath } from '../lib/routes';
import { RelaySettingsRedux } from '../redux/settings/reducers';
import { IReduxState, ReduxDispatch } from '../redux/store';
@@ -163,8 +164,8 @@ const mapDispatchToProps = (_dispatch: ReduxDispatch, props: IHistoryProps & IAp
return props.app.setDnsOptions(dns);
},
- onViewWireguardKeys: () => props.history.push('/settings/advanced/wireguard-keys'),
- onViewSplitTunneling: () => props.history.push('/settings/advanced/split-tunneling'),
+ onViewWireguardKeys: () => props.history.push(RoutePath.wireguardKeys),
+ onViewSplitTunneling: () => props.history.push(RoutePath.splitTunneling),
};
};
diff --git a/gui/src/renderer/containers/ConnectPage.tsx b/gui/src/renderer/containers/ConnectPage.tsx
index d7197095f1..2069b4012b 100644
--- a/gui/src/renderer/containers/ConnectPage.tsx
+++ b/gui/src/renderer/containers/ConnectPage.tsx
@@ -5,6 +5,7 @@ import log from '../../shared/logging';
import Connect from '../components/Connect';
import withAppContext, { IAppContext } from '../context';
import { IHistoryProps, withHistory } from '../lib/history';
+import { RoutePath } from '../lib/routes';
import { IRelayLocationRedux, RelaySettingsRedux } from '../redux/settings/reducers';
import { IReduxState, ReduxDispatch } from '../redux/store';
@@ -74,7 +75,7 @@ const mapStateToProps = (state: IReduxState) => {
const mapDispatchToProps = (_dispatch: ReduxDispatch, props: IHistoryProps & IAppContext) => {
return {
onSelectLocation: () => {
- props.history.show('/select-location');
+ props.history.show(RoutePath.selectLocation);
},
onConnect: async () => {
try {
diff --git a/gui/src/renderer/containers/ExpiredAccountErrorViewContainer.tsx b/gui/src/renderer/containers/ExpiredAccountErrorViewContainer.tsx
index 372f9607c9..e5c56e7f28 100644
--- a/gui/src/renderer/containers/ExpiredAccountErrorViewContainer.tsx
+++ b/gui/src/renderer/containers/ExpiredAccountErrorViewContainer.tsx
@@ -5,6 +5,7 @@ import { IHistoryProps, withHistory } from '../lib/history';
import withAppContext, { IAppContext } from '../context';
import { IReduxState, ReduxDispatch } from '../redux/store';
+import { RoutePath } from '../lib/routes';
const mapStateToProps = (state: IReduxState) => ({
accountToken: state.account.accountToken,
@@ -31,7 +32,7 @@ const mapDispatchToProps = (_dispatch: ReduxDispatch, props: IHistoryProps & IAp
}
},
navigateToRedeemVoucher: () => {
- props.history.push('/main/voucher/redeem');
+ props.history.push(RoutePath.redeemVoucher);
},
};
};
diff --git a/gui/src/renderer/containers/SettingsPage.tsx b/gui/src/renderer/containers/SettingsPage.tsx
index 57ded8cd24..da237abd23 100644
--- a/gui/src/renderer/containers/SettingsPage.tsx
+++ b/gui/src/renderer/containers/SettingsPage.tsx
@@ -2,6 +2,7 @@ import { connect } from 'react-redux';
import Settings from '../components/Settings';
import withAppContext, { IAppContext } from '../context';
import { IHistoryProps, withHistory } from '../lib/history';
+import { RoutePath } from '../lib/routes';
import { IReduxState, ReduxDispatch } from '../redux/store';
const mapStateToProps = (state: IReduxState, props: IAppContext) => ({
@@ -20,11 +21,11 @@ const mapDispatchToProps = (_dispatch: ReduxDispatch, props: IHistoryProps & IAp
return {
onQuit: () => props.app.quit(),
onClose: () => props.history.dismiss(),
- onViewSelectLanguage: () => props.history.push('/settings/language'),
- onViewAccount: () => props.history.push('/settings/account'),
- onViewSupport: () => props.history.push('/settings/support'),
- onViewPreferences: () => props.history.push('/settings/preferences'),
- onViewAdvancedSettings: () => props.history.push('/settings/advanced'),
+ onViewSelectLanguage: () => props.history.push(RoutePath.selectLanguage),
+ onViewAccount: () => props.history.push(RoutePath.accountSettings),
+ onViewSupport: () => props.history.push(RoutePath.support),
+ onViewPreferences: () => props.history.push(RoutePath.preferences),
+ onViewAdvancedSettings: () => props.history.push(RoutePath.advancedSettings),
onExternalLink: (url: string) => props.app.openUrl(url),
updateAccountData: () => props.app.updateAccountData(),
};