aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/first-time/create-vault-complete.js
blob: cd062effe5ac09e8c6539a27fd32db78e4ea0d2a (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
const inherits = require('util').inherits
const Component = require('react').Component
const connect = require('react-redux').connect
const h = require('react-hyperscript')
const actions = require('../actions')

module.exports = connect(mapStateToProps)(CreateVaultCompleteScreen)


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

function mapStateToProps(state) {
  return {
    seed: state.appState.currentView.context,
    cachedSeed: state.metamask.seedWords,
  }
}

CreateVaultCompleteScreen.prototype.render = function() {
  var state = this.props
  var seed = state.seed || state.cachedSeed

  return (

    h('.initialize-screen.flex-column.flex-center.flex-grow', [

      // subtitle and nav
      h('.section-title.flex-row.flex-center', [
        h('h2.page-subtitle', 'Vault Created'),
      ]),

      h('span.error', { // Error for the right red
        style: {
          padding: '12px 20px 0px 20px',
          textAlign: 'center',
        }
      }, 'These 12 words can restore all of your MetaMask accounts for this vault.\nSave them somewhere safe and secret.'),

      h('textarea.twelve-word-phrase', {
        readOnly: true,
        value: seed,
      }),

      h('button.btn-thin', {
        onClick: () => this.confirmSeedWords(),
      }, 'I\'ve copied it somewhere safe.'),
    ])
  )
}

CreateVaultCompleteScreen.prototype.confirmSeedWords = function() {
  this.props.dispatch(actions.confirmSeedWords())
}