aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-05-19 04:55:43 +0800
committerkumavis <aaron@kumavis.me>2016-05-19 04:55:43 +0800
commit6eebda73cfe77f0a62fe42b7eb1e4a9b9bf37bcb (patch)
treedd895fb630f1d16ee3ff421b45f3f0f05c0c9dcf
parent877648623e0b483d05291379b17d5a6646375b34 (diff)
downloadtangerine-wallet-browser-6eebda73cfe77f0a62fe42b7eb1e4a9b9bf37bcb.tar
tangerine-wallet-browser-6eebda73cfe77f0a62fe42b7eb1e4a9b9bf37bcb.tar.gz
tangerine-wallet-browser-6eebda73cfe77f0a62fe42b7eb1e4a9b9bf37bcb.tar.bz2
tangerine-wallet-browser-6eebda73cfe77f0a62fe42b7eb1e4a9b9bf37bcb.tar.lz
tangerine-wallet-browser-6eebda73cfe77f0a62fe42b7eb1e4a9b9bf37bcb.tar.xz
tangerine-wallet-browser-6eebda73cfe77f0a62fe42b7eb1e4a9b9bf37bcb.tar.zst
tangerine-wallet-browser-6eebda73cfe77f0a62fe42b7eb1e4a9b9bf37bcb.zip
ui - sendTx - re-add warning and fix form parsing
-rw-r--r--ui/app/send.js25
1 files changed, 15 insertions, 10 deletions
diff --git a/ui/app/send.js b/ui/app/send.js
index 56b23ee24..ae57b9677 100644
--- a/ui/app/send.js
+++ b/ui/app/send.js
@@ -21,6 +21,8 @@ function mapStateToProps(state) {
warning: state.appState.warning,
}
+ result.error = result.warning && result.warning.split('.')[0]
+
result.account = result.accounts[result.address]
result.identity = result.identities[result.address]
result.balance = result.account ? numericBalance(result.account.balance) : null
@@ -127,9 +129,13 @@ SendTransactionScreen.prototype.render = function() {
'Send Transaction',
]),
+ // error message
+ state.error && h('span.error.flex-center', state.error),
+
// 'to' field
h('section.flex-row.flex-center', [
- h('input.address.large-input', {
+ h('input.large-input', {
+ name: 'address',
placeholder: 'Recipient Address',
})
]),
@@ -137,7 +143,8 @@ SendTransactionScreen.prototype.render = function() {
// 'amount' and send button
h('section.flex-row.flex-center', [
- h('input.ether.large-input', {
+ h('input.large-input', {
+ name: 'amount',
placeholder: 'Amount',
type: 'number',
style: {
@@ -171,7 +178,8 @@ SendTransactionScreen.prototype.render = function() {
// 'data' field
h('section.flex-row.flex-center', [
- h('input.txData.large-input', {
+ h('input.large-input', {
+ name: 'txData',
placeholder: '0x01234',
style: {
width: '100%',
@@ -180,8 +188,6 @@ SendTransactionScreen.prototype.render = function() {
}),
]),
- // state.warning ? h('span.error', state.warning.split('.')[0]) : null,
-
])
)
@@ -198,11 +204,10 @@ SendTransactionScreen.prototype.back = function() {
}
SendTransactionScreen.prototype.onSubmit = function(event) {
- var recipient = document.querySelector('input.address').value
+ var recipient = document.querySelector('input[name="address"]').value
- var inputAmount = parseFloat(document.querySelector('input.ether').value)
- var currency = document.querySelector('select.currency').value
- var value = util.normalizeNumberToWei(inputAmount, currency)
+ var inputAmount = parseFloat(document.querySelector('input[name="amount"]').value)
+ var value = util.normalizeNumberToWei(inputAmount, 'ether')
var balance = this.props.balance
@@ -224,7 +229,7 @@ SendTransactionScreen.prototype.onSubmit = function(event) {
value: '0x' + value.toString(16),
}
- var txData = document.querySelector('textarea.txData').value
+ var txData = document.querySelector('input[name="txData"]').value
if (txData) txParams.data = txData
this.props.dispatch(actions.signTx(txParams))