30 lines
700 B
JavaScript
30 lines
700 B
JavaScript
var PlayerList = React.createClass({
|
|
propTypes: {
|
|
players: React.PropTypes.array,
|
|
game_id: React.PropTypes.number
|
|
},
|
|
|
|
render: function() {
|
|
var playerList = this;
|
|
var playerNodes = this.props.players.map(function (player) {
|
|
return (
|
|
<Player
|
|
key={player.id}
|
|
onPlayHandSubmit={playerList.props.onPlayHandSubmit}
|
|
current_player_id={playerList.props.current_player_id}
|
|
current_user_id={playerList.props.current_user_id}
|
|
user_id={player.user_id}
|
|
game_id={playerList.props.game_id} {...player} />
|
|
);
|
|
});
|
|
|
|
return (
|
|
<div>
|
|
PlayerList:
|
|
{playerNodes}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
});
|