Last active
March 5, 2018 20:10
-
-
Save goldensunliu/f7491edda4502034aedbaca401d4d541 to your computer and use it in GitHub Desktop.
This file contains 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 { | |
... | |
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