diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-09-18 01:34:29 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-09-20 05:31:10 +0800 |
commit | 5a6c333506e4000602c1a1106cee6d06fe83afa8 (patch) | |
tree | 2aed850f17114372eaca16ed7e77f42f87907713 /ui/app/components/transaction-list-item/transaction-list-item.component.js | |
parent | 3e470fee8a5560b605f7ad1060fb1eebafefd21e (diff) | |
download | tangerine-wallet-browser-5a6c333506e4000602c1a1106cee6d06fe83afa8.tar.gz tangerine-wallet-browser-5a6c333506e4000602c1a1106cee6d06fe83afa8.tar.zst tangerine-wallet-browser-5a6c333506e4000602c1a1106cee6d06fe83afa8.zip |
Switch existing modals from using Notification to Modal. Remove Notification component. Add CancelTransaction modal
Diffstat (limited to 'ui/app/components/transaction-list-item/transaction-list-item.component.js')
-rw-r--r-- | ui/app/components/transaction-list-item/transaction-list-item.component.js | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/ui/app/components/transaction-list-item/transaction-list-item.component.js b/ui/app/components/transaction-list-item/transaction-list-item.component.js index e590e96e0..72389c95b 100644 --- a/ui/app/components/transaction-list-item/transaction-list-item.component.js +++ b/ui/app/components/transaction-list-item/transaction-list-item.component.js @@ -12,17 +12,19 @@ import { ETH } from '../../constants/common' export default class TransactionListItem extends PureComponent { static propTypes = { + assetImages: PropTypes.object, history: PropTypes.object, - transaction: PropTypes.object, - value: PropTypes.string, methodData: PropTypes.object, - showRetry: PropTypes.bool, + nonceAndDate: PropTypes.string, retryTransaction: PropTypes.func, setSelectedToken: PropTypes.func, - nonceAndDate: PropTypes.string, + showCancelModal: PropTypes.func, + showCancel: PropTypes.bool, + showRetry: PropTypes.bool, token: PropTypes.object, - assetImages: PropTypes.object, tokenData: PropTypes.object, + transaction: PropTypes.object, + value: PropTypes.string, } state = { @@ -42,6 +44,11 @@ export default class TransactionListItem extends PureComponent { this.setState({ showTransactionDetails: !showTransactionDetails }) } + handleCancel = () => { + const { transaction: { id, txParams: { gasPrice } } = {}, showCancelModal } = this.props + showCancelModal(id, gasPrice) + } + handleRetry = () => { const { transaction: { txParams: { to } = {} }, @@ -100,12 +107,13 @@ export default class TransactionListItem extends PureComponent { render () { const { - transaction, + assetImages, methodData, - showRetry, nonceAndDate, - assetImages, + showCancel, + showRetry, tokenData, + transaction, } = this.props const { txParams = {} } = transaction const { showTransactionDetails } = this.state @@ -153,8 +161,10 @@ export default class TransactionListItem extends PureComponent { <div className="transaction-list-item__details-container"> <TransactionListItemDetails transaction={transaction} - showRetry={showRetry && methodData.done} onRetry={this.handleRetry} + showRetry={showRetry && methodData.done} + onCancel={this.handleCancel} + showCancel={showCancel} /> </div> ) |