diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-08-24 07:44:38 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-08-24 07:45:28 +0800 |
commit | 342522c6cf23670f931e69ba822eedfd2d6ee252 (patch) | |
tree | 7aac360f85308b3022d6f673a5c572385854e690 /ui/app/components/transaction-status | |
parent | 2d76ee754b1dd2473d744ce2dba2a3501c9a149c (diff) | |
download | tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.gz tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.bz2 tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.lz tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.xz tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.zst tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.zip |
Fix naming, add eth.getCode check for actions, fix translations for statuses
Diffstat (limited to 'ui/app/components/transaction-status')
-rw-r--r-- | ui/app/components/transaction-status/transaction-status.component.js | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/ui/app/components/transaction-status/transaction-status.component.js b/ui/app/components/transaction-status/transaction-status.component.js index 1b05d61b2..a4c827ae8 100644 --- a/ui/app/components/transaction-status/transaction-status.component.js +++ b/ui/app/components/transaction-status/transaction-status.component.js @@ -1,15 +1,16 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' - -const UNAPPROVED_STATUS = 'unapproved' -const REJECTED_STATUS = 'rejected' -const APPROVED_STATUS = 'approved' -const SIGNED_STATUS = 'signed' -const SUBMITTED_STATUS = 'submitted' -const CONFIRMED_STATUS = 'confirmed' -const FAILED_STATUS = 'failed' -const DROPPED_STATUS = 'dropped' +import { + UNAPPROVED_STATUS, + REJECTED_STATUS, + APPROVED_STATUS, + SIGNED_STATUS, + SUBMITTED_STATUS, + CONFIRMED_STATUS, + FAILED_STATUS, + DROPPED_STATUS, +} from '../../constants/transactions' const statusToClassNameHash = { [UNAPPROVED_STATUS]: 'transaction-status--unapproved', @@ -28,17 +29,22 @@ const statusToTextHash = { } export default class TransactionStatus extends PureComponent { + static contextTypes = { + t: PropTypes.func, + } + static propTypes = { - status: PropTypes.string, + statusKey: PropTypes.string, className: PropTypes.string, } render () { - const { className, status } = this.props + const { className, statusKey } = this.props + const statusText = this.context.t(statusToTextHash[statusKey] || statusKey) return ( - <div className={classnames('transaction-status', className, statusToClassNameHash[status])}> - { statusToTextHash[status] || status } + <div className={classnames('transaction-status', className, statusToClassNameHash[statusKey])}> + { statusText } </div> ) } |