diff --git a/src/components/IsUnlocked.js b/src/components/IsUnlocked.js index ebfd9a5e..c2da407b 100644 --- a/src/components/IsUnlocked.js +++ b/src/components/IsUnlocked.js @@ -4,10 +4,14 @@ import bcrypt from 'bcryptjs' import React, { Component } from 'react' import { connect } from 'react-redux' import { compose } from 'redux' +import styled from 'styled-components' import { translate } from 'react-i18next' import type { Account } from '@ledgerhq/live-common/lib/types' import type { Settings, T } from 'types/common' +import IconLockScreen from 'icons/LockScreen' + +import { ErrorMessageInput } from 'components/base/Input' import get from 'lodash/get' @@ -43,6 +47,7 @@ type Props = { } type State = { inputValue: InputValue, + incorrectPassword: boolean, } const mapStateToProps = state => ({ @@ -61,8 +66,27 @@ const defaultState = { inputValue: { password: '', }, + incorrectPassword: false, } +export const PageTitle = styled(Box).attrs({ + width: 152, + height: 27, + ff: 'Museo Sans|Regular', + fontSize: 7, + color: 'dark', +})`` + +export const LockScreenDesc = styled(Box).attrs({ + width: 340, + height: 36, + ff: 'Open Sans|Regular', + fontSize: 4, + textAlign: 'center', + color: 'smoke', +})` + margin: 10px auto 25px; +` class IsUnlocked extends Component { state = { ...defaultState, @@ -121,6 +145,8 @@ class IsUnlocked extends Component { this.setState({ ...defaultState, }) + } else { + this.setState({ incorrectPassword: true }) } } @@ -133,22 +159,36 @@ class IsUnlocked extends Component { _input: ?HTMLInputElement render() { - const { inputValue } = this.state + const { inputValue, incorrectPassword } = this.state const { isLocked, t } = this.props if (isLocked) { return (
- - (this._input = n)} - placeholder={t('common:password')} - type="password" - onChange={this.handleChangeInput('password')} - value={inputValue.password} - /> + + + {t('common:lockScreen.title')} + + {t('common:lockScreen.subTitle')} +
+ {t('common:lockScreen.description')} +
+ + (this._input = n)} + placeholder={t('common:lockScreen.inputPlaceholder')} + type="password" + onChange={this.handleChangeInput('password')} + value={inputValue.password} + /> + {incorrectPassword && ( + + {t('password:errorMessageIncorrectPassword')} + + )} +
diff --git a/src/components/OperationsList/Operation.js b/src/components/OperationsList/Operation.js index 1928a1d1..c3baafd1 100644 --- a/src/components/OperationsList/Operation.js +++ b/src/components/OperationsList/Operation.js @@ -49,6 +49,10 @@ const OperationRaw = styled(Box).attrs({ ` const Address = ({ value }: { value: string }) => { + if (!value) { + return + } + const addrSize = value.length / 2 const left = value.slice(0, 10) diff --git a/src/components/SettingsPage/DisablePasswordModal.js b/src/components/SettingsPage/DisablePasswordModal.js index 05753000..58ca0659 100644 --- a/src/components/SettingsPage/DisablePasswordModal.js +++ b/src/components/SettingsPage/DisablePasswordModal.js @@ -6,6 +6,7 @@ import bcrypt from 'bcryptjs' import Box from 'components/base/Box' import Button from 'components/base/Button' import InputPassword from 'components/base/InputPassword' +import Label from 'components/base/Label' import { ErrorMessageInput } from 'components/base/Input' import { Modal, ModalContent, ModalBody, ModalTitle, ModalFooter } from 'components/base/Modal' @@ -72,14 +73,14 @@ class DisablePasswordModal extends PureComponent { {t('settings:profile.disablePasswordModalTitle')} - - {t('settings:profile.disablePasswordModalSubtitle')} - {t('settings:profile.disablePasswordModalDesc')} {isPasswordEnabled && ( + { @@ -102,7 +89,7 @@ class TabProfile extends PureComponent { }) } - handleChangeRegion = (region: Object) => { + handleChangeRegion = (region: string) => { const { saveSettings } = this.props this.setState({ cachedRegion: region }) window.requestIdleCallback(() => { @@ -131,7 +118,7 @@ class TabProfile extends PureComponent { } = this.state const { languages } = this.getDatas() const currentLanguage = languages.find(l => l.key === cachedLanguageKey) - const currentRegion = COUNTRIES.find(r => r.key === cachedRegion.key) + const currentRegion = COUNTRIES.find(r => r.key === cachedRegion) return (
@@ -171,9 +158,8 @@ class TabProfile extends PureComponent {