0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 14:12:43 +00:00

Add conditional highlighting to Undo/Redo

This commit is contained in:
G.Ambatte
2021-10-18 22:26:34 +13:00
parent 5b3953094e
commit 606a3c843d

View File

@@ -24,7 +24,8 @@ const Snippetbar = createClass({
showEditButtons : true, showEditButtons : true,
renderer : 'legacy', renderer : 'legacy',
undo : ()=>{}, undo : ()=>{},
redo : ()=>{} redo : ()=>{},
historySize : ()=>{}
}; };
}, },
@@ -62,11 +63,11 @@ const Snippetbar = createClass({
if(!this.props.showEditButtons) return; if(!this.props.showEditButtons) return;
return <div className='editors'> return <div className='editors'>
<div className='editorTool undo' <div className={`editorTool undo ${this.props.historySize()?.undo ? 'active' : ''}`}
onClick={this.props.undo} > onClick={this.props.undo} >
<i className='fas fa-undo' /> <i className='fas fa-undo' />
</div> </div>
<div className='editorTool redo' <div className={`editorTool redo ${this.props.historySize()?.redo ? 'active' : ''}`}
onClick={this.props.redo} > onClick={this.props.redo} >
<i className='fas fa-redo' /> <i className='fas fa-redo' />
</div> </div>