mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
various fixes to transaction list (#8673)
This commit is contained in:
parent
93c2184bd9
commit
fbe16e8a5f
@ -118,6 +118,10 @@ export default class TransactionActivityLog extends PureComponent {
|
|||||||
const { t } = this.context
|
const { t } = this.context
|
||||||
const { className, activities } = this.props
|
const { className, activities } = this.props
|
||||||
|
|
||||||
|
if (activities.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classnames('transaction-activity-log', className)}>
|
<div className={classnames('transaction-activity-log', className)}>
|
||||||
<div className="transaction-activity-log__title">
|
<div className="transaction-activity-log__title">
|
||||||
|
@ -35,12 +35,12 @@ export default class TransactionListItemDetails extends PureComponent {
|
|||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
recipientEns: PropTypes.string,
|
recipientEns: PropTypes.string,
|
||||||
recipientAddress: PropTypes.string.isRequired,
|
recipientAddress: PropTypes.string,
|
||||||
rpcPrefs: PropTypes.object,
|
rpcPrefs: PropTypes.object,
|
||||||
senderAddress: PropTypes.string.isRequired,
|
senderAddress: PropTypes.string.isRequired,
|
||||||
tryReverseResolveAddress: PropTypes.func.isRequired,
|
tryReverseResolveAddress: PropTypes.func.isRequired,
|
||||||
senderNickname: PropTypes.string.isRequired,
|
senderNickname: PropTypes.string.isRequired,
|
||||||
recipientNickname: PropTypes.string.isRequired,
|
recipientNickname: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -95,11 +95,13 @@ export default class TransactionListItemDetails extends PureComponent {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async componentDidMount () {
|
componentDidMount () {
|
||||||
const { recipientAddress, tryReverseResolveAddress } = this.props
|
const { recipientAddress, tryReverseResolveAddress } = this.props
|
||||||
|
|
||||||
|
if (recipientAddress) {
|
||||||
tryReverseResolveAddress(recipientAddress)
|
tryReverseResolveAddress(recipientAddress)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
renderCancel () {
|
renderCancel () {
|
||||||
const { t } = this.context
|
const { t } = this.context
|
||||||
|
@ -10,8 +10,11 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
ensResolutionsByAddress,
|
ensResolutionsByAddress,
|
||||||
} = metamask
|
} = metamask
|
||||||
const { recipientAddress, senderAddress } = ownProps
|
const { recipientAddress, senderAddress } = ownProps
|
||||||
|
let recipientEns
|
||||||
|
if (recipientAddress) {
|
||||||
const address = checksumAddress(recipientAddress)
|
const address = checksumAddress(recipientAddress)
|
||||||
const recipientEns = ensResolutionsByAddress[address] || ''
|
recipientEns = ensResolutionsByAddress[address] || ''
|
||||||
|
}
|
||||||
const addressBook = getAddressBook(state)
|
const addressBook = getAddressBook(state)
|
||||||
|
|
||||||
const getNickName = (address) => {
|
const getNickName = (address) => {
|
||||||
@ -26,7 +29,7 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
rpcPrefs,
|
rpcPrefs,
|
||||||
recipientEns,
|
recipientEns,
|
||||||
senderNickname: getNickName(senderAddress),
|
senderNickname: getNickName(senderAddress),
|
||||||
recipientNickname: getNickName(recipientAddress),
|
recipientNickname: recipientAddress ? getNickName(recipientAddress) : null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import { useCancelTransaction } from '../../../hooks/useCancelTransaction'
|
|||||||
import { useRetryTransaction } from '../../../hooks/useRetryTransaction'
|
import { useRetryTransaction } from '../../../hooks/useRetryTransaction'
|
||||||
import Button from '../../ui/button'
|
import Button from '../../ui/button'
|
||||||
import Tooltip from '../../ui/tooltip'
|
import Tooltip from '../../ui/tooltip'
|
||||||
import TransactionListItemDetails from '../transaction-list-item-details/transaction-list-item-details.component'
|
import TransactionListItemDetails from '../transaction-list-item-details'
|
||||||
import { useHistory } from 'react-router-dom'
|
import { useHistory } from 'react-router-dom'
|
||||||
import { CONFIRM_TRANSACTION_ROUTE } from '../../../helpers/constants/routes'
|
import { CONFIRM_TRANSACTION_ROUTE } from '../../../helpers/constants/routes'
|
||||||
import {
|
import {
|
||||||
|
@ -112,7 +112,7 @@ export default function TransactionList ({ tokenAddress }) {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{(completedTransactions.length - limit + PAGE_INCREMENT) > 0 && (
|
{completedTransactions.length > limit && (
|
||||||
<Button className="transaction-list__view-more" type="secondary" rounded onClick={viewMore}>View More</Button>
|
<Button className="transaction-list__view-more" type="secondary" rounded onClick={viewMore}>View More</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user