Last active
March 5, 2018 18:38
-
-
Save goldensunliu/857d054f034b64d278ad39e79aa36ee6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game extends Compoent { | |
... | |
renderNumberControl() { | |
const selectedCell = this.getSelectedCell(); | |
const prefilled = selectedCell && selectedCell.get('prefilled'); | |
return ( | |
<div className="control"> | |
{range(9).map((i) => { | |
const number = i + 1; | |
// handles binding single click and double click callbacks | |
const clickHandle = getClickHandler( | |
() => { this.fillNumber(number); }, | |
() => { this.addNumberAsNote(number); }, | |
); | |
return ( | |
<NumberControl | |
key={number} | |
number={number} | |
onClick={!prefilled ? clickHandle : undefined} | |
completionPercentage={this.getNumberValueCount(number) / 9} | |
/>); | |
})} | |
<style jsx>{ControlStyle}</style> | |
</div> | |
); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment