Skip to content

Instantly share code, notes, and snippets.

@goldensunliu
Created February 23, 2018 23:08
Show Gist options
  • Save goldensunliu/a0ab53255fa94c180a9c65a2bd1e9d45 to your computer and use it in GitHub Desktop.
Save goldensunliu/a0ab53255fa94c180a9c65a2bd1e9d45 to your computer and use it in GitHub Desktop.
getSelectedCell() {
const { board } = this.state
const selected = board.get('selected')
return selected && board.get('puzzle').getIn([selected.x,selected.y])
}
renderCell(cell, x, y) {
const { board } = this.state
const selected = this.getSelectedCell()
const sameValue = selected && selected.get('value') && value === selected.get('value')
const isSelected = cell === selected
return <Cell prefilled={prefilled} notes={notes} sameValue={sameValue} isSelected={isSelected} isPeer={peer} value={value}
onClick={() => { this.selectCell(x, y)}} key={y} x={x} y={y} conflict={conflict}/>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment