/
AppViews.js
80 lines (74 loc) · 1.93 KB
/
AppViews.js
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
import React from 'react';
const exports = {};
exports.Wrapper = class extends React.Component {
render() {
const {content} = this.props;
return (
<div className="App">
<header className="App-header" id="root">
<h1>Rock, Paper, Scissors</h1>
{content}
</header>
</div>
);
}
}
exports.ConnectAccount = class extends React.Component {
render() {
return (
<div>
Please wait while we connect to your account.
If this takes more than a few seconds, there may be something wrong.
</div>
)
}
}
exports.FundAccount = class extends React.Component {
render() {
const {bal, standardUnit, defaultFundAmt, parent} = this.props;
const amt = (this.state || {}).amt || defaultFundAmt;
return (
<div>
<h2>Fund account</h2>
<br />
Balance: {bal} {standardUnit}
<hr />
Would you like to fund your account with additional {standardUnit}?
<br />
(This only works on certain devnets)
<br />
<input
type='number'
placeholder={defaultFundAmt}
onChange={(e) => this.setState({amt: e.currentTarget.value})}
/>
<button onClick={() => parent.fundAccount(amt)}>Fund Account</button>
<button onClick={() => parent.skipFundAccount()}>Skip</button>
</div>
);
}
}
exports.DeployerOrAttacher = class extends React.Component {
render() {
const {parent} = this.props;
return (
<div>
Please select a role:
<br />
<p>
<button
onClick={() => parent.selectDeployer()}
>Deployer</button>
<br /> Set the wager, deploy the contract.
</p>
<p>
<button
onClick={() => parent.selectAttacher()}
>Attacher</button>
<br /> Attach to the Deployer's contract.
</p>
</div>
);
}
}
export default exports;