1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 11:46:13 +02:00
metamask-extension/ui/app/components/modals/account-details-modal.js

87 lines
1.9 KiB
JavaScript
Raw Normal View History

const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../../actions')
2017-08-21 18:50:22 +02:00
const { getSelectedIdentity, getSelectedAddress } = require('../../selectors')
const QrView = require('../qr-code')
function mapStateToProps (state) {
return {
address: state.metamask.selectedAddress,
// selectedAddress: getSelectedAddress(state),
2017-08-21 18:50:22 +02:00
selectedIdentity: getSelectedIdentity(state),
}
}
function mapDispatchToProps (dispatch) {
return {
hideModal: () => {
dispatch(actions.hideModal())
2017-08-21 18:50:22 +02:00
},
showQrView: (selected, identity) => dispatch(actions.showQrView(selected, identity)),
}
}
inherits(AccountDetailsModal, Component)
function AccountDetailsModal () {
Component.call(this)
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDetailsModal)
// AccountDetailsModal is currently meant to be rendered inside <Modal />
// It is the only component in this codebase that does so
// It utilizes modal styles
AccountDetailsModal.prototype.render = function () {
const { selectedIdentity } = this.props
return h('div', {}, [
h('div.account-details-modal-wrapper', {
}, [
h('div', {}, [
'ICON',
]),
h('div', {}, [
'X',
]),
h('div', {}, [
]),
h(QrView, {
Qr: {
message: this.props.selectedIdentity.name,
data: this.props.selectedIdentity.address,
}
}, []),
h('div', {}, [
'Account Display',
]),
// divider
h('div', {
style: {
width: '100%',
height: '1px',
margin: '10px 0px',
backgroundColor: '#D8D8D8',
}
}, []),
h('div', {}, [
'View aCcount on etherscan',
]),
h('div', {}, [
'export private key',
]),
])
])
}