diff --git a/src/components/IsUnlocked.js b/src/components/IsUnlocked.js index 136b1066..c0cb10e3 100644 --- a/src/components/IsUnlocked.js +++ b/src/components/IsUnlocked.js @@ -4,22 +4,26 @@ import bcrypt from 'bcryptjs' import React, { Component } from 'react' import { connect } from 'react-redux' import { compose } from 'redux' +import { remote } from 'electron' import styled from 'styled-components' import { translate } from 'react-i18next' import type { SettingsState as Settings } from 'reducers/settings' import type { T } from 'types/common' import IconLockScreen from 'icons/LockScreen' - +import IconTriangleWarning from 'icons/TriangleWarning' import get from 'lodash/get' import { setEncryptionKey } from 'helpers/db' +import hardReset from 'helpers/hardReset' import { fetchAccounts } from 'actions/accounts' import { isLocked, unlock } from 'reducers/application' import Box from 'components/base/Box' import InputPassword from 'components/base/InputPassword' +import Button from './base/Button/index' +import ConfirmModal from './base/Modal/ConfirmModal' type InputValue = { password: string, @@ -36,6 +40,8 @@ type Props = { type State = { inputValue: InputValue, incorrectPassword: boolean, + isHardResetting: boolean, + isHardResetModalOpened: boolean, } const mapStateToProps = state => ({ @@ -53,6 +59,8 @@ const defaultState = { password: '', }, incorrectPassword: false, + isHardResetting: false, + isHardResetModalOpened: false, } export const PageTitle = styled(Box).attrs({ @@ -96,6 +104,7 @@ class IsUnlocked extends Component { ...prev.inputValue, [key]: value, }, + incorrectPassword: false, })) handleSubmit = async (e: SyntheticEvent) => { @@ -117,8 +126,25 @@ class IsUnlocked extends Component { } } + handleOpenHardResetModal = () => this.setState({ isHardResetModalOpened: true }) + handleCloseHardResetModal = () => this.setState({ isHardResetModalOpened: false }) + + handleHardReset = async () => { + this.setState({ isHardResetting: true }) + try { + await hardReset() + remote.getCurrentWindow().webContents.reloadIgnoringCache() + } catch (err) { + this.setState({ isHardResetting: false }) + } + } + hardResetIconRender = () => ( + + + + ) render() { - const { inputValue, incorrectPassword } = this.state + const { inputValue, incorrectPassword, isHardResetting, isHardResetModalOpened } = this.state const { isLocked, t } = this.props if (isLocked) { @@ -143,8 +169,22 @@ class IsUnlocked extends Component { error={incorrectPassword && t('app:password.errorMessageIncorrectPassword')} /> + + ) } @@ -164,3 +204,12 @@ export default compose( ), translate(), )(IsUnlocked) + +const IconWrapperCircle = styled(Box).attrs({})` + width: 50px; + height: 50px; + border-radius: 50%; + background: #ea2e4919; + text-align: -webkit-center; + justify-content: center; +` diff --git a/src/components/Onboarding/steps/Analytics.js b/src/components/Onboarding/steps/Analytics.js index 40969dc8..d92720bc 100644 --- a/src/components/Onboarding/steps/Analytics.js +++ b/src/components/Onboarding/steps/Analytics.js @@ -19,7 +19,7 @@ type State = { } const INITIAL_STATE = { - analyticsToggle: true, + analyticsToggle: false, sentryLogsToggle: true, } diff --git a/src/components/Onboarding/steps/GenuineCheck.js b/src/components/Onboarding/steps/GenuineCheck.js index bff77501..c4f97654 100644 --- a/src/components/Onboarding/steps/GenuineCheck.js +++ b/src/components/Onboarding/steps/GenuineCheck.js @@ -129,7 +129,12 @@ class GenuineCheck extends PureComponent { {t('onboarding:genuineCheck.title')} - {t('onboarding:genuineCheck.desc')} + {onboarding.isLedgerNano ? ( + {t('onboarding:genuineCheck.descNano')} + ) : ( + {t('onboarding:genuineCheck.descBlue')} + )} + diff --git a/src/components/SettingsPage/sections/Profile.js b/src/components/SettingsPage/sections/Profile.js index d3557f09..703b1e99 100644 --- a/src/components/SettingsPage/sections/Profile.js +++ b/src/components/SettingsPage/sections/Profile.js @@ -2,6 +2,7 @@ import React, { PureComponent } from 'react' import { connect } from 'react-redux' +import styled from 'styled-components' import { remote } from 'electron' import bcrypt from 'bcryptjs' @@ -19,6 +20,7 @@ import CheckBox from 'components/base/CheckBox' import Box from 'components/base/Box' import Button from 'components/base/Button' import { ConfirmModal } from 'components/base/Modal' +import IconTriangleWarning from 'icons/TriangleWarning' import IconUser from 'icons/User' import PasswordModal from '../PasswordModal' import DisablePasswordModal from '../DisablePasswordModal' @@ -125,6 +127,12 @@ class TabProfile extends PureComponent { }) } + hardResetIconRender = () => ( + + + + ) + render() { const { t, settings, saveSettings } = this.props const { @@ -223,8 +231,8 @@ class TabProfile extends PureComponent { onReject={this.handleCloseHardResetModal} onConfirm={this.handleHardReset} title={t('app:settings.hardResetModal.title')} - subTitle={t('app:settings.hardResetModal.subTitle')} desc={t('app:settings.hardResetModal.desc')} + renderIcon={this.hardResetIconRender} /> { onReject, onConfirm, isLoading, + renderIcon, t, ...props } = this.props @@ -57,6 +59,11 @@ class ConfirmModal extends PureComponent { {subTitle} )} + {renderIcon && ( + + {renderIcon()} + + )} {desc} diff --git a/src/components/modals/AccountSettingRenderBody.js b/src/components/modals/AccountSettingRenderBody.js index 60968fd2..95bb68fa 100644 --- a/src/components/modals/AccountSettingRenderBody.js +++ b/src/components/modals/AccountSettingRenderBody.js @@ -151,6 +151,7 @@ class HelperComp extends PureComponent { } onFocus={e => this.handleFocus(e, 'accountName')} diff --git a/src/icons/TriangleWarning.js b/src/icons/TriangleWarning.js new file mode 100644 index 00000000..569fff9d --- /dev/null +++ b/src/icons/TriangleWarning.js @@ -0,0 +1,16 @@ +// @flow + +import React from 'react' + +const path = ( + +) + +export default ({ height, width, ...p }: { height: number, width: number }) => ( + + {path} + +) diff --git a/src/reducers/settings.js b/src/reducers/settings.js index 2c28e884..eb6b8ec3 100644 --- a/src/reducers/settings.js +++ b/src/reducers/settings.js @@ -72,7 +72,7 @@ const INITIAL_STATE: SettingsState = { region, developerMode: !!process.env.__DEV__, loaded: false, - shareAnalytics: true, + shareAnalytics: false, sentryLogs: true, lastUsedVersion: __APP_VERSION__, } diff --git a/static/i18n/en/app.yml b/static/i18n/en/app.yml index 4ed1a761..4b00bb11 100644 --- a/static/i18n/en/app.yml +++ b/static/i18n/en/app.yml @@ -31,6 +31,7 @@ common: subTitle: Your application is locked description: Please enter your password to continue inputPlaceholder: Type your password + lostPassword: I lost my password sync: syncing: Syncing... upToDate: Up to date @@ -118,7 +119,7 @@ exchange: coinmama: 'Coinmama is a financial service that makes it fast, safe and fun to buy digital currency, anywhere in the world.' genuinecheck: modal: - title: Genuine check, bro + title: Genuine check addAccounts: title: Add accounts breadcrumb: @@ -306,9 +307,8 @@ settings: terms: Terms and Privacy policy termsDesc: Lorem ipsum dolor sit amet hardResetModal: - title: Hard reset - subTitle: Are you sure houston? - desc: Lorem ipsum dolor sit amet + title: Reset Ledger Live + desc: Resetting will erase all Ledger Live data stored on your computer, including your profile, accounts, transaction history and application settings. The keys to access your crypto assets in the blockchain remain secure on your Ledger device. softResetModal: title: Clean application cache subTitle: Are you sure houston? diff --git a/static/i18n/en/onboarding.yml b/static/i18n/en/onboarding.yml index 2fa67577..d09f78e2 100644 --- a/static/i18n/en/onboarding.yml +++ b/static/i18n/en/onboarding.yml @@ -74,7 +74,8 @@ writeSeed: note4: Never use a device supplied with a recovery phrase and/or a PIN code. genuineCheck: title: Final security check - desc: Your Ledger Nano S should now display Your device is now ready. Before getting started, please confirm that + descNano: Your Ledger Nano S should now display Your device is now ready. Before getting started, please confirm that + descBlue: Your Ledger Blue should now display Your device is now ready. Before getting started, please confirm that steps: step1: title: Did you choose your PIN code by yourself?