aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/send.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-06-22 05:24:28 +0800
committerGitHub <noreply@github.com>2016-06-22 05:24:28 +0800
commit537328b5298a42f9d20862d42b9012babcda373c (patch)
tree9a5728447f5b23a918b4a23c12e91ea1b702e527 /ui/app/send.js
parentbb7788373d9c234313d651d88c72c18a8e4ca0aa (diff)
parentd7c3e8e9f5182576eb4a990d385ff8ce4ebd417c (diff)
downloadtangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.gz
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.zst
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.zip
Merge pull request #303 from MetaMask/AutoLint
Auto lint
Diffstat (limited to 'ui/app/send.js')
-rw-r--r--ui/app/send.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/ui/app/send.js b/ui/app/send.js
index ba4e5bfff..82c378dd2 100644
--- a/ui/app/send.js
+++ b/ui/app/send.js
@@ -6,14 +6,13 @@ const Identicon = require('./components/identicon')
const actions = require('./actions')
const util = require('./util')
const numericBalance = require('./util').numericBalance
-const formatBalance = require('./util').formatBalance
const addressSummary = require('./util').addressSummary
const EtherBalance = require('./components/eth-balance')
const ethUtil = require('ethereumjs-util')
module.exports = connect(mapStateToProps)(SendTransactionScreen)
-function mapStateToProps(state) {
+function mapStateToProps (state) {
var result = {
address: state.metamask.selectedAccount,
accounts: state.metamask.accounts,
@@ -31,11 +30,11 @@ function mapStateToProps(state) {
}
inherits(SendTransactionScreen, Component)
-function SendTransactionScreen() {
+function SendTransactionScreen () {
Component.call(this)
}
-SendTransactionScreen.prototype.render = function() {
+SendTransactionScreen.prototype.render = function () {
var state = this.props
var address = state.address
var account = state.account
@@ -111,7 +110,7 @@ SendTransactionScreen.prototype.render = function() {
// h('div', formatBalance(account && account.balance)),
h(EtherBalance, {
value: account && account.balance,
- })
+ }),
]),
@@ -140,7 +139,7 @@ SendTransactionScreen.prototype.render = function() {
h('input.large-input', {
name: 'address',
placeholder: 'Recipient Address',
- })
+ }),
]),
// 'amount' and send button
@@ -160,7 +159,7 @@ SendTransactionScreen.prototype.render = function() {
style: {
textTransform: 'uppercase',
},
- }, 'Send')
+ }, 'Send'),
]),
@@ -187,7 +186,7 @@ SendTransactionScreen.prototype.render = function() {
style: {
width: '100%',
resize: 'none',
- }
+ },
}),
]),
@@ -196,31 +195,31 @@ SendTransactionScreen.prototype.render = function() {
)
}
-SendTransactionScreen.prototype.navigateToAccounts = function(event){
+SendTransactionScreen.prototype.navigateToAccounts = function (event) {
event.stopPropagation()
this.props.dispatch(actions.showAccountsPage())
}
-SendTransactionScreen.prototype.back = function() {
+SendTransactionScreen.prototype.back = function () {
var address = this.props.address
this.props.dispatch(actions.backToAccountDetail(address))
}
-SendTransactionScreen.prototype.onSubmit = function() {
-
+SendTransactionScreen.prototype.onSubmit = function () {
const recipient = document.querySelector('input[name="address"]').value
const input = document.querySelector('input[name="amount"]').value
const value = util.normalizeEthStringToWei(input)
const txData = document.querySelector('input[name="txData"]').value
const balance = this.props.balance
+ let message
if (value.gt(balance)) {
- var message = 'Insufficient funds.'
+ message = 'Insufficient funds.'
return this.props.dispatch(actions.displayWarning(message))
}
if ((!util.isValidAddress(recipient) && !txData) || (!recipient && !txData)) {
- var message = 'Recipient address is invalid.'
+ message = 'Recipient address is invalid.'
return this.props.dispatch(actions.displayWarning(message))
}