aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/transaction-list
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-08-07 04:45:56 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-08-24 07:45:27 +0800
commite104744d3b29af518bc60c45339d4d4458baaa68 (patch)
tree1b17904a5afb5e26ee0f52f7e1a63761c67101b4 /ui/app/components/transaction-list
parent33a94332e48b280fcf4c9fb23aa4d349eaa8a54d (diff)
downloadtangerine-wallet-browser-e104744d3b29af518bc60c45339d4d4458baaa68.tar.gz
tangerine-wallet-browser-e104744d3b29af518bc60c45339d4d4458baaa68.tar.zst
tangerine-wallet-browser-e104744d3b29af518bc60c45339d4d4458baaa68.zip
Fix shapeshift transactions. Delete unused files
Diffstat (limited to 'ui/app/components/transaction-list')
-rw-r--r--ui/app/components/transaction-list/index.scss6
-rw-r--r--ui/app/components/transaction-list/transaction-list.component.js44
2 files changed, 32 insertions, 18 deletions
diff --git a/ui/app/components/transaction-list/index.scss b/ui/app/components/transaction-list/index.scss
index f6f209831..0e8db485c 100644
--- a/ui/app/components/transaction-list/index.scss
+++ b/ui/app/components/transaction-list/index.scss
@@ -4,6 +4,12 @@
flex: 1;
overflow-y: hidden;
+ &__completed-transactions {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ }
+
&__header {
flex: 0 0 auto;
font-size: .875rem;
diff --git a/ui/app/components/transaction-list/transaction-list.component.js b/ui/app/components/transaction-list/transaction-list.component.js
index 953b07217..c1e1885f3 100644
--- a/ui/app/components/transaction-list/transaction-list.component.js
+++ b/ui/app/components/transaction-list/transaction-list.component.js
@@ -1,6 +1,8 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import TransactionListItem from '../transaction-list-item'
+import ShapeShiftTransactionListItem from '../shift-list-item'
+import { TRANSACTION_TYPE_SHAPESHIFT } from '../../constants/transactions'
export default class TransactionList extends PureComponent {
static contextTypes = {
@@ -28,11 +30,7 @@ export default class TransactionList extends PureComponent {
renderTransactions () {
const { t } = this.context
- const {
- pendingTransactions = [],
- completedTransactions = [],
- selectedToken,
- } = this.props
+ const { pendingTransactions = [], completedTransactions = [] } = this.props
return (
<div className="transaction-list__transactions">
@@ -43,13 +41,8 @@ export default class TransactionList extends PureComponent {
{ `${t('queue')} (${pendingTransactions.length})` }
</div>
{
- pendingTransactions.map(transaction => (
- <TransactionListItem
- transaction={transaction}
- key={transaction.id}
- showRetry={this.shouldShowRetry(transaction)}
- token={selectedToken}
- />
+ pendingTransactions.map((transaction, index) => (
+ this.renderTransaction(transaction, index)
))
}
</div>
@@ -61,12 +54,8 @@ export default class TransactionList extends PureComponent {
</div>
{
completedTransactions.length > 0
- ? completedTransactions.map(transaction => (
- <TransactionListItem
- transaction={transaction}
- key={transaction.id}
- token={selectedToken}
- />
+ ? completedTransactions.map((transaction, index) => (
+ this.renderTransaction(transaction, index)
))
: this.renderEmpty()
}
@@ -75,6 +64,25 @@ export default class TransactionList extends PureComponent {
)
}
+ renderTransaction (transaction, index) {
+ const { selectedToken } = this.props
+
+ return transaction.key === TRANSACTION_TYPE_SHAPESHIFT
+ ? (
+ <ShapeShiftTransactionListItem
+ { ...transaction }
+ key={`shapeshift${index}`}
+ />
+ ) : (
+ <TransactionListItem
+ transaction={transaction}
+ key={transaction.id}
+ showRetry={this.shouldShowRetry(transaction)}
+ token={selectedToken}
+ />
+ )
+ }
+
renderEmpty () {
return (
<div className="transaction-list__empty">