diff options
author | Dan <danjm.com@gmail.com> | 2018-03-22 08:58:58 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-03-22 08:58:58 +0800 |
commit | be845fd190ee71d2bb6e641a5c23c453668268e3 (patch) | |
tree | 28d5267d8c149b0e323351a9ebfa222de9d33bdc /ui/app/components/sender-to-recipient.js | |
parent | d24a0590d363dbe88d383c8faec8eb28809242f0 (diff) | |
parent | 04b1f8428b487663b276a541d739631954fe0be1 (diff) | |
download | tangerine-wallet-browser-be845fd190ee71d2bb6e641a5c23c453668268e3.tar.gz tangerine-wallet-browser-be845fd190ee71d2bb6e641a5c23c453668268e3.tar.zst tangerine-wallet-browser-be845fd190ee71d2bb6e641a5c23c453668268e3.zip |
Merge branch 'master' into i18n-translator-redux
Diffstat (limited to 'ui/app/components/sender-to-recipient.js')
-rw-r--r-- | ui/app/components/sender-to-recipient.js | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/ui/app/components/sender-to-recipient.js b/ui/app/components/sender-to-recipient.js index dc72dc303..420d50e42 100644 --- a/ui/app/components/sender-to-recipient.js +++ b/ui/app/components/sender-to-recipient.js @@ -5,6 +5,28 @@ const PropTypes = require('prop-types') const Identicon = require('./identicon') class SenderToRecipient extends Component { + renderRecipientIcon () { + const { recipientAddress } = this.props + return ( + recipientAddress + ? h(Identicon, { address: recipientAddress, diameter: 20 }) + : h('i.fa.fa-file-text-o') + ) + } + + renderRecipient () { + const { recipientName } = this.props + return ( + h('.sender-to-recipient__recipient', [ + this.renderRecipientIcon(), + h( + '.sender-to-recipient__name.sender-to-recipient__recipient-name', + recipientName || this.props.t('newContract') + ), + ]) + ) + } + render () { const { senderName, senderAddress } = this.props @@ -28,10 +50,7 @@ class SenderToRecipient extends Component { }), ]), ]), - h('.sender-to-recipient__recipient', [ - h('i.fa.fa-file-text-o'), - h('.sender-to-recipient__name.sender-to-recipient__recipient-name', this.props.t('newContract')), - ]), + this.renderRecipient(), ]) ) } @@ -41,6 +60,8 @@ SenderToRecipient.propTypes = { senderName: PropTypes.string, senderAddress: PropTypes.string, localeMessages: PropTypes.object, + recipientName: PropTypes.string, + recipientAddress: PropTypes.string, } module.exports = { |