summaryrefslogtreecommitdiffhomepage
path: root/app/components/Login.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/Login.js
parentae9c255b3ecdec341090c932db6cb261147a7382 (diff)
parent1214138633bcca19a1b96622400f3fbcf4044bd9 (diff)
downloadmullvadvpn-de737c54c413f96c35b4e9bc6280fc7d26e4fa83.tar.xz
mullvadvpn-de737c54c413f96c35b4e9bc6280fc7d26e4fa83.zip
Merge branch 'update-flow'
Diffstat (limited to 'app/components/Login.js')
-rw-r--r--app/components/Login.js37
1 files changed, 21 insertions, 16 deletions
diff --git a/app/components/Login.js b/app/components/Login.js
index c133954eed..3231fc7710 100644
--- a/app/components/Login.js
+++ b/app/components/Login.js
@@ -1,5 +1,5 @@
// @flow
-import React, { Component } from 'react';
+import * as React from 'react';
import { Layout, Container, Header } from './Layout';
import AccountInput from './AccountInput';
import { formatAccount } from '../lib/formatters';
@@ -20,8 +20,13 @@ export type LoginPropTypes = {
onRemoveAccountTokenFromHistory: (accountToken: AccountToken) => void,
};
-export default class Login extends Component {
- props: LoginPropTypes;
+type State = {
+ notifyOnFirstChangeAfterFailure: boolean,
+ isActive: boolean,
+ dropdownHeight: number
+};
+
+export default class Login extends React.Component<LoginPropTypes, State> {
state = {
notifyOnFirstChangeAfterFailure: false,
isActive: false,
@@ -293,13 +298,13 @@ export default class Login extends Component {
}
}
-class AccountDropdown extends Component {
- props: {
- items: Array<AccountToken>,
- onSelect: ((value: AccountToken) => void),
- onRemove: ((value: AccountToken) => void)
- };
+type AccountDropdownProps = {
+ items: Array<AccountToken>,
+ onSelect: (value: AccountToken) => void,
+ onRemove: (value: AccountToken) => void,
+};
+class AccountDropdown extends React.Component<AccountDropdownProps> {
render() {
const uniqueItems = [...new Set(this.props.items)];
return (
@@ -316,14 +321,14 @@ class AccountDropdown extends Component {
}
}
-class AccountDropdownItem extends Component {
- props: {
- label: string,
- value: AccountToken,
- onRemove: (value: AccountToken) => void,
- onSelect: (value: AccountToken) => void
- };
+type AccountDropdownItemProps = {
+ label: string,
+ value: AccountToken,
+ onRemove: (value: AccountToken) => void,
+ onSelect: (value: AccountToken) => void,
+};
+class AccountDropdownItem extends React.Component<AccountDropdownItemProps> {
render() {
return (
<div className="login-form__account-dropdown__item">