1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Restore History title on wide viewport (#8277)

The `History` title above the transaction history was changed in #8264
to only show when there are pending transactions, because it was
redundant to show an additional `History` title below a tab called
`History`. It was preserved when there were pending transactions
because the pending transactions are shown first in the list, followed
by the history, so the title served to divide the two lists.

This ended up breaking the fullscreen view though, which doesn't use
tabs yet. It has been updated to always show on fullscreen.
This commit is contained in:
Mark Stacey 2020-04-01 18:11:50 -03:00 committed by GitHub
parent 6b6615be27
commit 043ed6cbdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 8 deletions

View File

@ -15,6 +15,7 @@ export default class TransactionList extends PureComponent {
}
static propTypes = {
isWideViewport: PropTypes.bool.isRequired,
pendingTransactions: PropTypes.array,
completedTransactions: PropTypes.array,
selectedToken: PropTypes.object,
@ -80,7 +81,7 @@ export default class TransactionList extends PureComponent {
renderTransactions () {
const { t } = this.context
const { pendingTransactions = [], completedTransactions = [] } = this.props
const { isWideViewport, pendingTransactions = [], completedTransactions = [] } = this.props
const pendingLength = pendingTransactions.length
return (
@ -101,11 +102,13 @@ export default class TransactionList extends PureComponent {
}
<div className="transaction-list__completed-transactions">
{
pendingLength > 0 && (
<div className="transaction-list__header">
{ t('history') }
</div>
)
isWideViewport || pendingLength > 0
? (
<div className="transaction-list__header">
{ t('history') }
</div>
)
: null
}
{
completedTransactions.length > 0

View File

@ -1,4 +1,5 @@
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import TransactionList from './transaction-list.component'
import {
nonceSortedCompletedTransactionsSelector,
@ -43,4 +44,14 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
}
}
export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(TransactionList)
const TransactionListContainer = connect(mapStateToProps, mapDispatchToProps, mergeProps)(TransactionList)
TransactionListContainer.propTypes = {
isWideViewport: PropTypes.bool,
}
TransactionListContainer.defaultProps = {
isWideViewport: false,
}
export default TransactionListContainer

View File

@ -189,7 +189,7 @@ export default class Home extends PureComponent {
<div className="home__balance-wrapper">
<TransactionViewBalance />
</div>
<TransactionList />
<TransactionList isWideViewport />
</div>
</>
)