mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add button to retry transaction
This commit is contained in:
parent
6ff580584a
commit
500fbe450a
@ -46,7 +46,7 @@ TransactionListItem.prototype.render = function () {
|
|||||||
|
|
||||||
const isClickable = ('hash' in transaction && isLinkable) || isPending
|
const isClickable = ('hash' in transaction && isLinkable) || isPending
|
||||||
return (
|
return (
|
||||||
h(`.transaction-list-item.flex-row.flex-space-between${isClickable ? '.pointer' : ''}`, {
|
h('.transaction-list-item.flex-column', {
|
||||||
onClick: (event) => {
|
onClick: (event) => {
|
||||||
if (isPending) {
|
if (isPending) {
|
||||||
this.props.showTx(transaction.id)
|
this.props.showTx(transaction.id)
|
||||||
@ -58,48 +58,83 @@ TransactionListItem.prototype.render = function () {
|
|||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
padding: '20px 0',
|
padding: '20px 0',
|
||||||
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
}, [
|
}, [
|
||||||
|
h(`.flex-row.flex-space-between${isClickable ? '.pointer' : ''}`, {
|
||||||
h('.identicon-wrapper.flex-column.flex-center.select-none', [
|
style: {
|
||||||
h(TransactionIcon, { txParams, transaction, isTx, isMsg }),
|
width: '100%',
|
||||||
]),
|
},
|
||||||
|
|
||||||
h(Tooltip, {
|
|
||||||
title: 'Transaction Number',
|
|
||||||
position: 'right',
|
|
||||||
}, [
|
}, [
|
||||||
h('span', {
|
h('.identicon-wrapper.flex-column.flex-center.select-none', [
|
||||||
|
h(TransactionIcon, { txParams, transaction, isTx, isMsg }),
|
||||||
|
]),
|
||||||
|
|
||||||
|
h(Tooltip, {
|
||||||
|
title: 'Transaction Number',
|
||||||
|
position: 'right',
|
||||||
|
}, [
|
||||||
|
h('span', {
|
||||||
|
style: {
|
||||||
|
display: 'flex',
|
||||||
|
cursor: 'normal',
|
||||||
|
flexDirection: 'column',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
padding: '10px',
|
||||||
|
},
|
||||||
|
}, nonce),
|
||||||
|
]),
|
||||||
|
|
||||||
|
h('.flex-column', {style: {width: '200px', overflow: 'hidden'}}, [
|
||||||
|
domainField(txParams),
|
||||||
|
h('div', date),
|
||||||
|
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' }}),
|
||||||
|
|
||||||
|
isTx ? h(EthBalance, {
|
||||||
|
value: txParams.value,
|
||||||
|
conversionRate,
|
||||||
|
currentCurrency,
|
||||||
|
width: '55px',
|
||||||
|
shorten: true,
|
||||||
|
showFiat: false,
|
||||||
|
style: {fontSize: '15px'},
|
||||||
|
}) : h('.flex-column'),
|
||||||
|
]),
|
||||||
|
|
||||||
|
transaction.status === 'submitted' && h('.transition-list-item__retry', {
|
||||||
|
onClick: event => {
|
||||||
|
event.stopPropagation()
|
||||||
|
this.resubmit()
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
height: '30px',
|
||||||
|
borderRadius: '30px',
|
||||||
|
color: '#F9881B',
|
||||||
|
padding: '0 25px',
|
||||||
|
backgroundColor: '#FFE3C9',
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
fontSize: '9px',
|
||||||
|
cursor: 'pointer',
|
||||||
|
},
|
||||||
|
}, [
|
||||||
|
h('div', {
|
||||||
style: {
|
style: {
|
||||||
display: 'flex',
|
paddingRight: '2px',
|
||||||
cursor: 'normal',
|
|
||||||
flexDirection: 'column',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
padding: '10px',
|
|
||||||
},
|
},
|
||||||
}, nonce),
|
}, 'Taking too long?'),
|
||||||
|
h('div', {
|
||||||
|
style: {
|
||||||
|
textDecoration: 'underline',
|
||||||
|
},
|
||||||
|
}, 'Retry with a higher gas price here'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
h('.flex-column', {style: {width: '200px', overflow: 'hidden'}}, [
|
|
||||||
domainField(txParams),
|
|
||||||
h('div', date),
|
|
||||||
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' }}),
|
|
||||||
|
|
||||||
isTx ? h(EthBalance, {
|
|
||||||
value: txParams.value,
|
|
||||||
conversionRate,
|
|
||||||
currentCurrency,
|
|
||||||
width: '55px',
|
|
||||||
shorten: true,
|
|
||||||
showFiat: false,
|
|
||||||
style: {fontSize: '15px'},
|
|
||||||
}) : h('.flex-column'),
|
|
||||||
|
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user