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

[WIP] Aggregate data for QRView

This commit is contained in:
sdtsui 2017-08-21 09:50:22 -07:00
parent 86b71f014a
commit fe5817051b
2 changed files with 18 additions and 3 deletions

View File

@ -3,10 +3,15 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../../actions')
const { getSelectedIdentity, getSelectedAddress } = require('../../selectors')
const QrView = require('../qr-code')
function mapStateToProps (state) {
return {
address: state.metamask.selectedAddress,
selectedAddress: getSelectedAddress(state),
selectedIdentity: getSelectedIdentity(state),
}
}
@ -14,7 +19,8 @@ function mapDispatchToProps (dispatch) {
return {
hideModal: () => {
dispatch(actions.hideModal())
}
},
showQrView: (selected, identity) => dispatch(actions.showQrView(selected, identity)),
}
}
@ -45,7 +51,12 @@ AccountDetailsModal.prototype.render = function () {
]),
h('div', {}, [
'QR Code',
h(QrView, {
Qr: {
message: this.props.selectedAddress,
data: this.props.selectedIdentity,
}
}, []),
]),
h('div', {}, [

View File

@ -10,7 +10,11 @@ module.exports = connect(mapStateToProps)(QrCodeView)
function mapStateToProps (state) {
return {
Qr: state.appState.Qr,
// Qr: state.appState.Qr,
/*
Qr.message - address
Qr.data - identity
*/
buyView: state.appState.buyView,
warning: state.appState.warning,
}