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 { className, activities } = this.props
|
||||
|
||||
if (activities.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={classnames('transaction-activity-log', className)}>
|
||||
<div className="transaction-activity-log__title">
|
||||
|
@ -35,12 +35,12 @@ export default class TransactionListItemDetails extends PureComponent {
|
||||
title: PropTypes.string.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
recipientEns: PropTypes.string,
|
||||
recipientAddress: PropTypes.string.isRequired,
|
||||
recipientAddress: PropTypes.string,
|
||||
rpcPrefs: PropTypes.object,
|
||||
senderAddress: PropTypes.string.isRequired,
|
||||
tryReverseResolveAddress: PropTypes.func.isRequired,
|
||||
senderNickname: PropTypes.string.isRequired,
|
||||
recipientNickname: PropTypes.string.isRequired,
|
||||
recipientNickname: PropTypes.string,
|
||||
}
|
||||
|
||||
state = {
|
||||
@ -95,10 +95,12 @@ export default class TransactionListItemDetails extends PureComponent {
|
||||
})
|
||||
}
|
||||
|
||||
async componentDidMount () {
|
||||
componentDidMount () {
|
||||
const { recipientAddress, tryReverseResolveAddress } = this.props
|
||||
|
||||
tryReverseResolveAddress(recipientAddress)
|
||||
if (recipientAddress) {
|
||||
tryReverseResolveAddress(recipientAddress)
|
||||
}
|
||||
}
|
||||
|
||||
renderCancel () {
|
||||
|
@ -10,8 +10,11 @@ const mapStateToProps = (state, ownProps) => {
|
||||
ensResolutionsByAddress,
|
||||
} = metamask
|
||||
const { recipientAddress, senderAddress } = ownProps
|
||||
const address = checksumAddress(recipientAddress)
|
||||
const recipientEns = ensResolutionsByAddress[address] || ''
|
||||
let recipientEns
|
||||
if (recipientAddress) {
|
||||
const address = checksumAddress(recipientAddress)
|
||||
recipientEns = ensResolutionsByAddress[address] || ''
|
||||
}
|
||||
const addressBook = getAddressBook(state)
|
||||
|
||||
const getNickName = (address) => {
|
||||
@ -26,7 +29,7 @@ const mapStateToProps = (state, ownProps) => {
|
||||
rpcPrefs,
|
||||
recipientEns,
|
||||
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 Button from '../../ui/button'
|
||||
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 { CONFIRM_TRANSACTION_ROUTE } from '../../../helpers/constants/routes'
|
||||
import {
|
||||
|
@ -112,7 +112,7 @@ export default function TransactionList ({ tokenAddress }) {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
{(completedTransactions.length - limit + PAGE_INCREMENT) > 0 && (
|
||||
{completedTransactions.length > limit && (
|
||||
<Button className="transaction-list__view-more" type="secondary" rounded onClick={viewMore}>View More</Button>
|
||||
)}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user