diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-07-07 02:58:41 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-07-07 07:27:08 +0800 |
commit | a2d9c43fba49680d7553409a4f5013d3febd80e9 (patch) | |
tree | 56417ef3c675774173da49d3edfb951a3310fd5e /ui/app/components/confirm-page-container/confirm-page-container-content/confirm-page-container-error | |
parent | 9cde5ab11b0670eed7baeb2f31486cb3e253bdcb (diff) | |
download | tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.tar.gz tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.tar.zst tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.zip |
Various fixes from PR comments
Diffstat (limited to 'ui/app/components/confirm-page-container/confirm-page-container-content/confirm-page-container-error')
-rw-r--r-- | ui/app/components/confirm-page-container/confirm-page-container-content/confirm-page-container-error/confirm-page-container-error.component.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/app/components/confirm-page-container/confirm-page-container-content/confirm-page-container-error/confirm-page-container-error.component.js b/ui/app/components/confirm-page-container/confirm-page-container-content/confirm-page-container-error/confirm-page-container-error.component.js index dc5b9b935..70ebdeb20 100644 --- a/ui/app/components/confirm-page-container/confirm-page-container-content/confirm-page-container-error/confirm-page-container-error.component.js +++ b/ui/app/components/confirm-page-container/confirm-page-container-content/confirm-page-container-error/confirm-page-container-error.component.js @@ -1,20 +1,28 @@ import React from 'react' import PropTypes from 'prop-types' -const ConfirmPageContainerError = props => { +const ConfirmPageContainerError = (props, context) => { + const { errorMessage, errorKey } = props + const error = errorKey ? context.t(errorKey) : errorMessage + return ( <div className="confirm-page-container-error"> <img src="/images/alert-red.svg" className="confirm-page-container-error__icon" /> - { `ALERT: ${props.error}` } + { `ALERT: ${error}` } </div> ) } ConfirmPageContainerError.propTypes = { - error: PropTypes.string, + errorMessage: PropTypes.string, + errorKey: PropTypes.string, +} + +ConfirmPageContainerError.contextTypes = { + t: PropTypes.func, } export default ConfirmPageContainerError |