Move to global undo and combined map action state
This commit is contained in:
@@ -22,6 +22,9 @@ import FullScreenExitIcon from "../../icons/FullScreenExitIcon";
|
||||
import NoteToolIcon from "../../icons/NoteToolIcon";
|
||||
import SelectToolIcon from "../../icons/SelecToolIcon";
|
||||
|
||||
import UndoButton from "../controls/shared/UndoButton";
|
||||
import RedoButton from "../controls/shared/RedoButton";
|
||||
|
||||
import useSetting from "../../hooks/useSetting";
|
||||
|
||||
import { Map, MapTool, MapToolId } from "../../types/Map";
|
||||
@@ -48,6 +51,8 @@ type MapControlsProps = {
|
||||
onToolAction: (actionId: string) => void;
|
||||
disabledControls: MapToolId[];
|
||||
disabledSettings: Partial<Record<keyof Settings, string[]>>;
|
||||
onUndo: () => void;
|
||||
onRedo: () => void;
|
||||
};
|
||||
|
||||
function MapContols({
|
||||
@@ -62,6 +67,8 @@ function MapContols({
|
||||
onToolAction,
|
||||
disabledControls,
|
||||
disabledSettings,
|
||||
onUndo,
|
||||
onRedo,
|
||||
}: MapControlsProps) {
|
||||
const [isExpanded, setIsExpanded] = useState(true);
|
||||
const [fullScreen, setFullScreen] = useSetting("map.fullScreen");
|
||||
@@ -144,6 +151,15 @@ function MapContols({
|
||||
</RadioIconButton>
|
||||
)),
|
||||
},
|
||||
{
|
||||
id: "history",
|
||||
component: (
|
||||
<>
|
||||
<UndoButton onClick={onUndo} />
|
||||
<RedoButton onClick={onRedo} />
|
||||
</>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
let controls = null;
|
||||
|
||||
Reference in New Issue
Block a user