diff options
Diffstat (limited to 'language-web/src/main/js/editor/EditorButtons.jsx')
-rw-r--r-- | language-web/src/main/js/editor/EditorButtons.jsx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/language-web/src/main/js/editor/EditorButtons.jsx b/language-web/src/main/js/editor/EditorButtons.jsx new file mode 100644 index 00000000..b9f0d076 --- /dev/null +++ b/language-web/src/main/js/editor/EditorButtons.jsx | |||
@@ -0,0 +1,27 @@ | |||
1 | import { observer } from 'mobx-react-lite'; | ||
2 | import React from 'react'; | ||
3 | import IconButton from '@material-ui/core/IconButton'; | ||
4 | import RedoIcon from '@material-ui/icons/Redo'; | ||
5 | import UndoIcon from '@material-ui/icons/Undo'; | ||
6 | |||
7 | import { useRootStore } from '../RootStore'; | ||
8 | |||
9 | export default observer(() => { | ||
10 | const editorStore = useRootStore().editorStore; | ||
11 | return ( | ||
12 | <> | ||
13 | <IconButton | ||
14 | disabled={!editorStore.canUndo} | ||
15 | onClick={() => editorStore.undo()} | ||
16 | > | ||
17 | <UndoIcon fontSize='small'/> | ||
18 | </IconButton> | ||
19 | <IconButton | ||
20 | disabled={!editorStore.canRedo} | ||
21 | onClick={() => editorStore.redo()} | ||
22 | > | ||
23 | <RedoIcon fontSize='small'/> | ||
24 | </IconButton> | ||
25 | </> | ||
26 | ); | ||
27 | }); | ||