aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/eth-store-warning.js
blob: d77cc08705cd10daee5b58bab4a4012fcf2b585a (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const connect = require('react-redux').connect
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const actions = require('./actions')

module.exports = connect(mapStateToProps)(EthStoreWarning)

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

function mapStateToProps (state) {
  return {
    selectedAccount: state.metamask.selectedAccount,
  }
}

EthStoreWarning.prototype.render = function () {

  return (

    h('.flex-column', {
      key: 'ethWarning',
      style: {
        paddingTop: '25px',
        marginRight: '30px',
        marginLeft: '30px',
        alignItems: 'center',
      },
    }, [
      h('.warning', {
        style: {
          margin: '10px 10px 10px 10px',
        },
      },
        `MetaMask is currently in beta -
        exercise caution while handling
        and storing your ether.
        `),

      h('i.fa.fa-exclamation-triangle.fa-4', {
        style: {
          fontSize: '152px',
          color: '#AEAEAE',
          textAlign: 'center',
        },
      }),

      h('.flex-row', {
        style: {
          marginTop: '25px',
          marginBottom: '10px',
        },
      }, [
        h('input', {
          type: 'checkbox',
          onChange: this.toggleShowWarning.bind(this),
        }),
        h('.warning', {
          style: {
            fontSize: '11px',
          },

        }, 'Dont show me this message again'),
      ]),
      h('.flex-row', {
        style: {
          width: '100%',
          justifyContent: 'space-around',
        },
      }, [
        h('button', {
          onClick: this.toAccounts.bind(this),
        },
          'Continue to MetaMask'),
      ]),
    ])
  )
}

EthStoreWarning.prototype.toggleShowWarning = function () {
  this.props.dispatch(actions.agreeToEthWarning())
}

EthStoreWarning.prototype.toAccounts = function () {
  this.props.dispatch(actions.showAccountDetail(this.props.account))
}