-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModernArt.jsx
59 lines (54 loc) · 1.3 KB
/
ModernArt.jsx
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
class ArtPieceView extends React.Component {
render() {
return (
<div>
<div>Artist: {this.props.artPiece.artist}</div>
<div>Auction Type: {this.props.artPiece.auctionType}</div>
</div>
);
}
}
class CardsView extends React.Component {
render() {
return (
<div>
Number of cards: {this.props.cards.length}
{this.props.cards.map(a => <ArtPieceView artPiece={a} />)}
</div>
);
}
}
class PlayerView extends React.Component {
render() {
return (
<div>
<div>Name: {this.props.player.name}</div>
<div>Index: {this.props.player.index}</div>
<div>Cash: {this.props.player.cash}</div>
<div>Hand: <CardsView cards={this.props.player.hand} /></div>
<div>Board: <CardsView cards={this.props.player.board} /></div>
</div>
);
}
}
class ModernArtView extends React.Component {
render() {
return (
<div>
Number of players: {this.props.game.players.length}
{this.props.game.players.map(p => <PlayerView key={p.name} player={p} />)}
</div>
);
}
}
class ModernArtGameRoom extends React.Component {
render() {
return (
<div>
<button>Create game</button>
<div>Open games:</div>
</div>
);
}
}
window.ModernArtView = ModernArtView;