Skip to content

Commit

Permalink
Card list items now have ids in DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
bcrebel committed May 3, 2018
1 parent 0fbdc72 commit 0029fa6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Game/Cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ class Card extends React.Component {

render() {

return (<li type={this.props.type} status={this.state.status} onClick={this.handleClick} className={this.state.flipped ? styles.flipped : null}>
return (<li type={this.props.type}
id={this.props.id}
status={this.state.status} onClick={this.handleClick}
className={this.state.flipped ? styles.flipped : null}>
{this.props.children}
</li>)
}
Expand Down Expand Up @@ -85,7 +88,7 @@ class CardContainer extends React.Component {

return symbols.map((symbol, idx) =>

<Card key={'card-' + idx} type={symbol} clickEvent={this.gameStatus} id={symbol}>
<Card key={'card-' + idx} type={symbol} clickEvent={this.gameStatus} id={idx}>
<div>
<figure className={styles.front}></figure>
<figure className={styles.back}>{symbol}</figure>
Expand Down

0 comments on commit 0029fa6

Please sign in to comment.