28 lines
874 B
JavaScript
28 lines
874 B
JavaScript
var Player = React.createClass({
|
|
propTypes: {
|
|
email: React.PropTypes.string,
|
|
id: React.PropTypes.number
|
|
},
|
|
|
|
render: function() {
|
|
return (
|
|
<div style={{border: '1px solid', margin: '8px', padding: '8px'}}>
|
|
<div>Player Id: {this.props.id}</div>
|
|
<div>Email: {this.props.email}</div>
|
|
<div>Inventory count: {this.props.inventory_count}</div>
|
|
|
|
{/* Show player controls if player is owned by current_user */}
|
|
{this.props.user_id == this.props.current_user_id
|
|
? (<PlayerControls
|
|
key={this.props.id}
|
|
onPlayHandSubmit={this.props.onPlayHandSubmit}
|
|
game_id={this.props.game_id}
|
|
player_id={this.props.id}
|
|
inventory={this.props.inventory}
|
|
current_player_id={this.props.current_player_id} /> )
|
|
: null }
|
|
</div>
|
|
);
|
|
}
|
|
});
|