various fixes to transaction list (#8673)

feature/default_network_editable
Brad Decker 5 years ago committed by GitHub
parent 93c2184bd9
commit fbe16e8a5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ui/app/components/app/transaction-activity-log/transaction-activity-log.component.js
  2. 10
      ui/app/components/app/transaction-list-item-details/transaction-list-item-details.component.js
  3. 9
      ui/app/components/app/transaction-list-item-details/transaction-list-item-details.container.js
  4. 2
      ui/app/components/app/transaction-list-item/transaction-list-item.component.js
  5. 2
      ui/app/components/app/transaction-list/transaction-list.component.js

@ -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,10 +95,12 @@ export default class TransactionListItemDetails extends PureComponent {
}) })
} }
async componentDidMount () { componentDidMount () {
const { recipientAddress, tryReverseResolveAddress } = this.props const { recipientAddress, tryReverseResolveAddress } = this.props
tryReverseResolveAddress(recipientAddress) if (recipientAddress) {
tryReverseResolveAddress(recipientAddress)
}
} }
renderCancel () { renderCancel () {

@ -10,8 +10,11 @@ const mapStateToProps = (state, ownProps) => {
ensResolutionsByAddress, ensResolutionsByAddress,
} = metamask } = metamask
const { recipientAddress, senderAddress } = ownProps const { recipientAddress, senderAddress } = ownProps
const address = checksumAddress(recipientAddress) let recipientEns
const recipientEns = ensResolutionsByAddress[address] || '' if (recipientAddress) {
const address = checksumAddress(recipientAddress)
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…
Cancel
Save