nifty-wallet/ui/app/components/pending-msg.js

57 lines
1.2 KiB
JavaScript
Raw Normal View History

const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
2016-06-24 17:22:27 -07:00
const PendingTxDetails = require('./pending-msg-details')
module.exports = PendingMsg
inherits(PendingMsg, Component)
2016-06-21 13:18:32 -07:00
function PendingMsg () {
Component.call(this)
}
2016-06-21 13:18:32 -07:00
PendingMsg.prototype.render = function () {
var state = this.props
var msgData = state.txData
return (
2016-06-24 17:22:27 -07:00
h('div', {
key: msgData.id,
}, [
2016-06-24 17:22:27 -07:00
// header
2016-05-03 14:44:36 -07:00
h('h3', {
style: {
fontWeight: 'bold',
textAlign: 'center',
2016-06-21 13:18:32 -07:00
},
2016-05-03 14:44:36 -07:00
}, 'Sign Message'),
2017-02-09 17:31:44 -08:00
h('.error', {
style: {
margin: '10px',
},
}, `Signing this message can have
dangerous side effects. Only sign messages from
sites you fully trust with your entire account.
This will be fixed in a future version.`),
2016-06-24 17:22:27 -07:00
// message details
h(PendingTxDetails, state),
2016-06-24 17:22:27 -07:00
// sign + cancel
h('.flex-row.flex-space-around', [
h('button', {
onClick: state.cancelMessage,
}, 'Cancel'),
h('button', {
onClick: state.signMessage,
}, 'Sign'),
]),
])
2016-06-24 17:27:42 -07:00
)
}