diff --git a/src/components/IsUnlocked.js b/src/components/IsUnlocked.js index f5d8827f..8c56e2f3 100644 --- a/src/components/IsUnlocked.js +++ b/src/components/IsUnlocked.js @@ -20,11 +20,15 @@ import hardReset from 'helpers/hardReset' import { fetchAccounts } from 'actions/accounts' import { isLocked, unlock } from 'reducers/application' +import { createCustomErrorClass } from 'helpers/errors' + import Box from 'components/base/Box' import InputPassword from 'components/base/InputPassword' import Button from './base/Button/index' import ConfirmModal from './base/Modal/ConfirmModal' +const PasswordIncorrectError = createCustomErrorClass('PasswordIncorrect') + type InputValue = { password: string, } @@ -39,7 +43,7 @@ type Props = { } type State = { inputValue: InputValue, - incorrectPassword: boolean, + incorrectPassword: ?Error, isHardResetting: boolean, isHardResetModalOpened: boolean, } @@ -58,7 +62,7 @@ const defaultState = { inputValue: { password: '', }, - incorrectPassword: false, + incorrectPassword: null, isHardResetting: false, isHardResetModalOpened: false, } @@ -104,7 +108,7 @@ class IsUnlocked extends Component { ...prev.inputValue, [key]: value, }, - incorrectPassword: false, + incorrectPassword: null, })) handleSubmit = async (e: SyntheticEvent) => { @@ -122,7 +126,7 @@ class IsUnlocked extends Component { ...defaultState, }) } else { - this.setState({ incorrectPassword: true }) + this.setState({ incorrectPassword: new PasswordIncorrectError() }) } } @@ -177,7 +181,7 @@ class IsUnlocked extends Component { type="password" onChange={this.handleChangeInput('password')} value={inputValue.password} - error={incorrectPassword && t('app:password.errorMessageIncorrectPassword')} + error={incorrectPassword} /> ) : null} diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 4f71cff9..bb5fddf8 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -51,9 +51,6 @@ "error": "Synchronization error", "refresh": "Refresh", "ago": "Synced {{time}}" - }, - "error": { - "load": "Unable to load" } }, "buttons": { @@ -97,8 +94,7 @@ "advancedLogs": "Advanced logs", "accountName": { "title": "Account name", - "desc": "Describe this account", - "error": "An account name is required" + "desc": "Describe this account" }, "unit": { "title": "Unit", @@ -106,8 +102,7 @@ }, "endpointConfig": { "title": "Node", - "desc": "The API node to use", - "error": "Invalid endpoint" + "desc": "The API node to use" } } }, @@ -339,10 +334,10 @@ "confirmation": { "title": "Confirmation", "success": { + "title": "Transaction sent", + "text": + "The transaction has been signed and sent to the network. Your account balance will update once the blockchain has confirmed the transaction.", "cta": "View operation details" - }, - "error": { - "cta": "Retry" } } } @@ -452,8 +447,6 @@ } }, "password": { - "errorMessageIncorrectPassword": "The password you entered is incorrect", - "errorMessageNotMatchingPassword": "Passwords don't match", "inputFields": { "newPassword": { "label": "New password" diff --git a/static/i18n/en/errors.json b/static/i18n/en/errors.json index 732a5b95..95de8c5f 100644 --- a/static/i18n/en/errors.json +++ b/static/i18n/en/errors.json @@ -3,6 +3,10 @@ "title": "{{message}}", "description": "Something went wrong. Please retry or contact us." }, + "AccountNameRequired": { + "title": "An account name is required", + "description": "Please provide with an account name" + }, "BtcUnmatchedApp": { "title": "That's the wrong app", "description": "Open the ‘{{managerAppName}}’ app on your device" @@ -31,6 +35,10 @@ "title": "Oops, device was disconnected", "description": "The connection to the device was lost, so please try again." }, + "EnpointConfig": { + "title": "Invalid endpoint", + "description": "Please provide with a valid endpoint" + }, "FeeEstimationFailed": { "title": "Sorry, fee estimation failed", "description": "Try setting a custom fee (status: {{status}})" @@ -93,6 +101,18 @@ "title": "Oops, not enough balance", "description": "Make sure the account to debit has sufficient balance" }, + "PasswordsDontMatch": { + "title": "Passwords don't match", + "description": "Please try again" + }, + "PasswordIncorrect": { + "title": "The password you entered is incorrect", + "description": "Please try again" + }, + "SelectExchangesLoadError": { + "title": "Unable to load", + "description": "Can't load the exchanges" + }, "TimeoutError": { "title": "Oops, a time out occurred", "description": "It took too long for the server to respond."