aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/send-v2.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-04-10 17:49:01 +0800
committerDan <danjm.com@gmail.com>2018-04-10 17:49:01 +0800
commitf4d8da927734b2dcd597d1cc833f9fe6ac59cc77 (patch)
tree24984f09e1a0a86b8187ffee5197e3857a2b10cc /ui/app/send-v2.js
parent284dd85a99f538b77fd477f4952117d1792f64a5 (diff)
parent29dab1e9e00c1c1e6ad834026df51b2839d3171d (diff)
downloadtangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.gz
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.bz2
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.lz
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.xz
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.tar.zst
tangerine-wallet-browser-f4d8da927734b2dcd597d1cc833f9fe6ac59cc77.zip
Merge branch 'master' into i3725-refactor-send-component
Diffstat (limited to 'ui/app/send-v2.js')
-rw-r--r--ui/app/send-v2.js27
1 files changed, 24 insertions, 3 deletions
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js
index d608957c8..9c540671b 100644
--- a/ui/app/send-v2.js
+++ b/ui/app/send-v2.js
@@ -30,6 +30,7 @@ const {
getGasTotal,
} = require('./components/send/send-utils')
const { isValidAddress } = require('./util')
+const { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } = require('./routes')
import PageContainer from './components/page-container/page-container.component'
import SendHeader from './components/send_/send-header/send-header.container'
@@ -186,6 +187,25 @@ SendTransactionScreen.prototype.componentDidUpdate = function (prevProps) {
}
}
+SendTransactionScreen.prototype.renderHeader = function () {
+ const { selectedToken, clearSend, history } = this.props
+
+ return h('div.page-container__header', [
+
+ h('div.page-container__title', selectedToken ? this.context.t('sendTokens') : this.context.t('sendETH')),
+
+ h('div.page-container__subtitle', this.context.t('onlySendToEtherAddress')),
+
+ h('div.page-container__header-close', {
+ onClick: () => {
+ clearSend()
+ history.push(DEFAULT_ROUTE)
+ },
+ }),
+
+ ])
+}
+
SendTransactionScreen.prototype.renderErrorMessage = function (errorType) {
const { errors } = this.props
const errorMessage = errors[errorType]
@@ -478,12 +498,12 @@ SendTransactionScreen.prototype.renderForm = function () {
SendTransactionScreen.prototype.renderFooter = function () {
const {
- goHome,
clearSend,
gasTotal,
tokenBalance,
selectedToken,
errors: { amount: amountError, to: toError },
+ history,
} = this.props
const missingTokenBalance = selectedToken && !tokenBalance
@@ -492,7 +512,7 @@ SendTransactionScreen.prototype.renderFooter = function () {
return h(PageContainerFooter, {
onCancel: () => {
clearSend()
- goHome()
+ history.push(DEFAULT_ROUTE)
},
onSubmit: e => this.onSubmit(e),
disabled: !noErrors || !gasTotal || missingTokenBalance,
@@ -600,7 +620,6 @@ SendTransactionScreen.prototype.onSubmit = function (event) {
if (editingTransactionId) {
const editedTx = this.getEditedTx()
-
updateTx(editedTx)
} else {
@@ -624,4 +643,6 @@ SendTransactionScreen.prototype.onSubmit = function (event) {
? signTokenTx(selectedToken.address, to, amount, txParams)
: signTx(txParams)
}
+
+ this.props.history.push(CONFIRM_TRANSACTION_ROUTE)
}