Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Game extends Compoent {
...
renderActions() {
const { history } = this.state;
const selectedCell = this.getSelectedCell();
const prefilled = selectedCell && selectedCell.get('prefilled');
return (
<div className="actions">
<div className="action" onClick={history.size ? this.undo : null}>
<ReloadIcon />Undo
</div>
<div className="action redo" onClick={history.size ? this.redo : null}>
<ReloadIcon />Redo
</div>
<div className="action" onClick={!prefilled ? this.eraseSelected : null}>
<RemoveIcon />Erase
</div>
<div
className="action"
onClick={!prefilled ?
this.fillSelectedWithSolution : null}
>
<LoupeIcon />Hint
</div>
<style jsx>{ActionsStyle}</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.