1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Persist send tx form field values

This commit is contained in:
Dan Finlay 2016-08-25 14:10:07 -07:00
parent 2026b674c5
commit b39bd5333b

View File

@ -1,5 +1,5 @@
const inherits = require('util').inherits const inherits = require('util').inherits
const Component = require('react').Component const PersistentForm = require('../lib/persistent-form')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('react-redux').connect const connect = require('react-redux').connect
const Identicon = require('./components/identicon') const Identicon = require('./components/identicon')
@ -29,12 +29,14 @@ function mapStateToProps (state) {
return result return result
} }
inherits(SendTransactionScreen, Component) inherits(SendTransactionScreen, PersistentForm)
function SendTransactionScreen () { function SendTransactionScreen () {
Component.call(this) PersistentForm.call(this)
} }
SendTransactionScreen.prototype.render = function () { SendTransactionScreen.prototype.render = function () {
this.persistentFormParentId = 'send-tx-form'
var state = this.props var state = this.props
var address = state.address var address = state.address
var account = state.account var account = state.account
@ -137,6 +139,9 @@ SendTransactionScreen.prototype.render = function () {
h('input.large-input', { h('input.large-input', {
name: 'address', name: 'address',
placeholder: 'Recipient Address', placeholder: 'Recipient Address',
dataset: {
persistentFormId: 'recipient-address',
},
}), }),
]), ]),
@ -150,6 +155,9 @@ SendTransactionScreen.prototype.render = function () {
style: { style: {
marginRight: 6, marginRight: 6,
}, },
dataset: {
persistentFormId: 'tx-amount',
},
}), }),
h('button.primary', { h('button.primary', {
@ -185,11 +193,12 @@ SendTransactionScreen.prototype.render = function () {
width: '100%', width: '100%',
resize: 'none', resize: 'none',
}, },
dataset: {
persistentFormId: 'tx-data',
},
}), }),
]), ]),
]) ])
) )
} }