aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/wallet-view.js
blob: b61b534475938e146634c0f5dd95948cd4958cf1 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
const Component = require('react').Component
const connect = require('react-redux').connect
const h = require('react-hyperscript')
const inherits = require('util').inherits
const Identicon = require('./identicon')
const AccountDropdowns = require('./account-dropdowns').AccountDropdowns

module.exports = connect(mapStateToProps)(WalletView)

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


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

const noop = () => {}

WalletView.prototype.render = function () {
  const selected = '0x82df11beb942BEeeD58d466fCb0F0791365C7684'
  const { network } = this.props

  return h('div.wallet-view.flex-column', {
    style: {
      flexGrow: 1,
      height: '82vh',
      background: '#FAFAFA', // TODO: add to reusable colors
    }
  }, [

    // TODO: Separate component: wallet account details
    h('div.flex-row.flex-center', {
      style: {
        marginLeft: '35px',
        marginRight: '35px',
        marginTop: '35px',
      }
    }, [

      h('.identicon-wrapper.select-none', [
        h(Identicon, {
          diameter: 24,
          address: selected,
        }),
      ]),

      h('span', {
        style: {
          fontSize: '1.5em',
          marginLeft: '10px', // TODO: switch all units for this component to em
        }
      }, [
        'Account 1'
      ]),

      h(
        AccountDropdowns,
        {
          style: {
            marginRight: '8px',
            marginLeft: 'auto',
            cursor: 'pointer',
          },
          selected,
          network, // TODO: this prop could be in the account dropdown container
          identities: {},
        },
      ),

    ]),

    // TODO: Separate component: wallet contents
    h('div.flex-column', {
      style: {
        marginLeft: '35px',
        marginTop: '15px',
        alignItems: 'flex-start',
      }
    }, [

      h('span', {
        style: {
          fontSize: '1.1em',
        },
      }, 'Wallet'),

      h('span', {
        style: {
          fontSize: '1.8em',
          margin: '10px 0px',
        },
      }, '1001.124 ETH'),

      h('span', {
        style: {
          fontSize: '1.3em',
        },
      }, '$300,000.00 USD'),

      h('div', {
        style: {
          position: 'absolute',
          marginLeft: '-35px',
          height: '6em',
          width: '4px',
          background: '#D8D8D8', // TODO: add to resuable colors
        }
      }, [
      ])
    ]),

    // Buy Buttons
    // for index.css
    // 
    // TODO: move into a class
    // div.wallet-btn {
    //   border: 1px solid rgb(91, 93, 103);
    //   border-radius: 2px;
    //   height: 30px;
    //   width: 75px;
    //   font-size: 0.8em;
    //   text-align: center;
    //   line-height: 25px;
    // }

    h('div.flex-row', {
      style: {
        marginLeft: '35px',
        marginTop: '10px',
      }
    }, [
      h('div', {
        style: {
          border: '1px solid rgb(91, 93, 103)',
          borderRadius: '2px',
          height: '30px',
          width: '75px',
          fontSize: '0.8em',
          textAlign: 'center',
          lineHeight: '25px',
        }
      }, 'BUY'),
      h('div.wallet-btn', {
        style: {
          border: '1px solid rgb(91, 93, 103)',
          borderRadius: '2px',
          height: '30px',
          width: '75px',
          fontSize: '0.8em',
          textAlign: 'center',
          lineHeight: '25px',
          // spacing...
          marginLeft: '15px',
        }
      }, 'SEND'),
    ]),


    // Wallet contents

  ])
}