aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/export-private-key-modal.js
blob: 28b988f5adcfdddb917426ed1931164985b79250 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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')
const AccountModalContainer = require('./account-modal-container')
const { getSelectedIdentity } = require('../../selectors')
const ReadOnlyInput = require('../readonly-input')

function mapStateToProps (state) {
  return {
    network: state.metamask.network,
    selectedIdentity: getSelectedIdentity(state),
  }
}

inherits(ExportPrivateKeyModal, Component)
function ExportPrivateKeyModal () {
  Component.call(this)
}

module.exports = connect(mapStateToProps)(ExportPrivateKeyModal)

ExportPrivateKeyModal.prototype.render = function () {
  const { selectedIdentity, network } = this.props
  const { name, address } = selectedIdentity

  return h(AccountModalContainer, {}, [

      h('span.account-name', name),

      h(ReadOnlyInput, {
        wrapperClass: 'ellip-address-wrapper',
        inputClass: 'ellip-address',
        value: address,
      }),

      h('div.account-modal-divider'),
      
      h('span.modal-body-title', 'Download Private Keys'),

      h('div.private-key-password', {}, [
        h('span.private-key-password-label', 'Type Your Password'),

        h('input.private-key-password-input', {
          type: 'password',
          placeholder: 'Type password',
        }),
      ]),

      h('div.private-key-password-warning', `Warning: Never disclose this key.
        Anyone with your private keys can take steal any assets held in your
        account.`
      ),

      h('div.export-private-key-buttons', {}, [
        h('button.btn-clear.btn-cancel', {}, 'Cancel'),

        h('button.btn-clear', 'Download'),
      ]),
      
  ])
}