32
common/resources/client/text-editor/menubar/history-buttons.tsx
Executable file
32
common/resources/client/text-editor/menubar/history-buttons.tsx
Executable file
@@ -0,0 +1,32 @@
|
||||
import React from 'react';
|
||||
import {IconButton} from '../../ui/buttons/icon-button';
|
||||
import {UndoIcon} from '../../icons/material/Undo';
|
||||
import {RedoIcon} from '../../icons/material/Redo';
|
||||
import {MenubarButtonProps} from './menubar-button-props';
|
||||
|
||||
export function HistoryButtons({editor}: MenubarButtonProps) {
|
||||
return (
|
||||
<span>
|
||||
<IconButton
|
||||
size="md"
|
||||
disabled={!editor.can().undo()}
|
||||
onClick={() => {
|
||||
editor.commands.focus();
|
||||
editor.commands.undo();
|
||||
}}
|
||||
>
|
||||
<UndoIcon />
|
||||
</IconButton>
|
||||
<IconButton
|
||||
size="md"
|
||||
disabled={!editor.can().redo()}
|
||||
onClick={() => {
|
||||
editor.commands.focus();
|
||||
editor.commands.redo();
|
||||
}}
|
||||
>
|
||||
<RedoIcon />
|
||||
</IconButton>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user