diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-17 17:06:21 +0000 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-17 17:06:21 +0000 |
| commit | 8d35d8c06e3de2b3cd4be7bdfc28084f176b2bce (patch) | |
| tree | 8925b9c3c7b285a07e14c01ff72d070f1a7088a8 /app/components/Login.js | |
| parent | 00b82cb3aa904b34d7000854bcecd3b72e012c8e (diff) | |
| download | mullvadvpn-8d35d8c06e3de2b3cd4be7bdfc28084f176b2bce.tar.xz mullvadvpn-8d35d8c06e3de2b3cd4be7bdfc28084f176b2bce.zip | |
- Format account in settings page
- Add links to configuration
- Make links work on Settings page
Diffstat (limited to 'app/components/Login.js')
| -rw-r--r-- | app/components/Login.js | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/app/components/Login.js b/app/components/Login.js index 13dd42aad1..c2ff818bc9 100644 --- a/app/components/Login.js +++ b/app/components/Login.js @@ -2,7 +2,8 @@ import { shell } from 'electron'; import React, { Component, PropTypes } from 'react'; import { If, Then, Else } from 'react-if'; import { Layout, Container, Header } from './Layout'; -import { createAccountURL, LoginState } from '../constants'; +import { links, LoginState } from '../constants'; +import { formatAccount } from '../lib/formatters'; export default class Login extends Component { static propTypes = { @@ -35,7 +36,7 @@ export default class Login extends Component { } handleCreateAccount() { - shell.openExternal(createAccountURL); + shell.openExternal(links.createAccount); } handleInputChange(e) { @@ -56,16 +57,6 @@ export default class Login extends Component { } } - formattedAccount(val) { - // display number altogether when longer than 12 - if(val.length > 12) { - return val; - } - - // display quartets - return val.replace(/([0-9]{4})/g, '$1 ').trim(); - } - formTitle(s) { switch(s) { case LoginState.connecting: return 'Logging in...'; @@ -132,7 +123,7 @@ export default class Login extends Component { const { account, status, error } = this.props.user; const title = this.formTitle(status); const subtitle = this.formSubtitle(status, error); - const displayAccount = this.formattedAccount(account); + const displayAccount = formatAccount(account); const isConnecting = status === LoginState.connecting; const isFailed = status === LoginState.failed; const isLoggedIn = status === LoginState.ok; |
