Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.