From ac7f67a02004bd30282d6f722a52508e2875f627 Mon Sep 17 00:00:00 2001 From: viktor Date: Thu, 2 Aug 2018 18:54:38 +0300 Subject: [PATCH] Fix tx list item display --- old-ui/app/components/copyButton.js | 3 ++- old-ui/app/components/transaction-list-item.js | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/old-ui/app/components/copyButton.js b/old-ui/app/components/copyButton.js index e8b1efd75..7e1fe2126 100644 --- a/old-ui/app/components/copyButton.js +++ b/old-ui/app/components/copyButton.js @@ -20,13 +20,14 @@ CopyButton.prototype.render = function () { const state = this.state || {} const value = props.value + const display = props.display const copied = state.copied const message = copied ? 'Copied' : props.title || ' Copy ' return h('.copy-button', { style: { - display: 'flex', + display: display || 'flex', alignItems: 'center', }, }, [ diff --git a/old-ui/app/components/transaction-list-item.js b/old-ui/app/components/transaction-list-item.js index a2918b6eb..4099b39d9 100644 --- a/old-ui/app/components/transaction-list-item.js +++ b/old-ui/app/components/transaction-list-item.js @@ -156,8 +156,6 @@ TransactionListItem.prototype.render = function () { domainField(txParams), h('div.flex-row', [ recipientField(txParams, transaction, isTx, isMsg), - // Places a copy button if tx is successful, else places a placeholder empty div. - transaction.hash ? h(CopyButton, { value: transaction.hash }) : h('div', {style: { display: 'flex', alignItems: 'center', width: '26px' }}), ]), h('div', { style: { @@ -253,6 +251,8 @@ function recipientField (txParams, transaction, isTx, isMsg) { }, }, [ message, + // Places a copy button if tx is successful, else places a placeholder empty div. + transaction.hash ? h(CopyButton, { value: transaction.hash, display: 'inline-flex' }) : h('div', {style: { display: 'flex', alignItems: 'center', width: '26px' }}), renderErrorOrWarning(transaction), ]) } @@ -266,12 +266,12 @@ function renderErrorOrWarning (transaction) { // show dropped if (status === 'dropped') { - return h('span.dropped', ' (Dropped)') + return h('div.dropped', ' (Dropped)') } // show rejected if (status === 'rejected') { - return h('span.error', ' (Rejected)') + return h('div.error', ' (Rejected)') } // show error @@ -282,7 +282,7 @@ function renderErrorOrWarning (transaction) { title: message, position: 'bottom', }, [ - h(`span.error`, ` (Failed)`), + h(`div.error`, ` (Failed)`), ]) ) } @@ -294,7 +294,7 @@ function renderErrorOrWarning (transaction) { title: message, position: 'bottom', }, [ - h(`span.warning`, ` (Warning)`), + h(`div.warning`, ` (Warning)`), ]) } }