summaryrefslogtreecommitdiffhomepage
path: root/app/containers
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-06-22 15:28:52 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-07-03 13:37:54 +0200
commitd8569969ff508d139140a128b136ccfff06a89f5 (patch)
treea581504b79ca85a8fa5bc7cc8729d6a66215db8d /app/containers
parent6af054e0b7321e7f8ce2dc1c32d907e36c6218ee (diff)
downloadmullvadvpn-d8569969ff508d139140a128b136ccfff06a89f5.tar.xz
mullvadvpn-d8569969ff508d139140a128b136ccfff06a89f5.zip
Pass individual props instead of AccountReduxState
Diffstat (limited to 'app/containers')
-rw-r--r--app/containers/LoginPage.js26
1 files changed, 15 insertions, 11 deletions
diff --git a/app/containers/LoginPage.js b/app/containers/LoginPage.js
index 807c141799..fcf4dc8b7f 100644
--- a/app/containers/LoginPage.js
+++ b/app/containers/LoginPage.js
@@ -11,9 +11,15 @@ import { openLink } from '../lib/platform';
import type { ReduxState, ReduxDispatch } from '../redux/store';
import type { SharedRouteProps } from '../routes';
-const mapStateToProps = (state: ReduxState) => ({
- account: state.account,
-});
+const mapStateToProps = (state: ReduxState) => {
+ const { accountToken, accountHistory, error, status } = state.account;
+ return {
+ accountToken,
+ accountHistory,
+ loginError: error,
+ loginState: status,
+ };
+};
const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => {
const { push: pushHistory } = bindActionCreators({ push }, dispatch);
const { login, resetLoginError, updateAccountToken } = bindActionCreators(
@@ -22,20 +28,18 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) =>
);
const { backend } = props;
return {
- onSettings: () => {
+ openSettings: () => {
pushHistory('/settings');
},
- onLogin: (account) => {
+ login: (account) => {
login(backend, account);
},
- onFirstChangeAfterFailure: () => {
+ resetLoginError: () => {
resetLoginError();
},
- onExternalLink: (type) => openLink(links[type]),
- onAccountTokenChange: (token) => {
- updateAccountToken(token);
- },
- onRemoveAccountTokenFromHistory: (token) => backend.removeAccountFromHistory(token),
+ openExternalLink: (type) => openLink(links[type]),
+ updateAccountToken: updateAccountToken,
+ removeAccountTokenFromHistory: (token) => backend.removeAccountFromHistory(token),
};
};