diff --git a/src/routes/v2/pages/Editor/components/HistoryContent/HistoryWindowMiniContent.tsx b/src/routes/v2/pages/Editor/components/HistoryContent/HistoryWindowMiniContent.tsx new file mode 100644 index 000000000..d5f26cc77 --- /dev/null +++ b/src/routes/v2/pages/Editor/components/HistoryContent/HistoryWindowMiniContent.tsx @@ -0,0 +1,62 @@ +import { observer } from "mobx-react-lite"; +import type { MouseEvent, PointerEvent } from "react"; + +import TooltipButton from "@/components/shared/Buttons/TooltipButton"; +import { Icon } from "@/components/ui/icon"; +import { InlineStack } from "@/components/ui/layout"; +import { useEditorSession } from "@/routes/v2/pages/Editor/store/EditorSessionContext"; +import { tracking } from "@/utils/tracking"; + +const stopPointer = (event: PointerEvent) => { + event.stopPropagation(); +}; + +export const HistoryWindowMiniContent = observer( + function HistoryWindowMiniContent() { + const { undo } = useEditorSession(); + const { canUndo, canRedo } = undo; + + const handleUndo = (event: MouseEvent) => { + event.stopPropagation(); + undo.undo(); + }; + + const handleRedo = (event: MouseEvent) => { + event.stopPropagation(); + undo.redo(); + }; + + return ( + + + + + + + + + ); + }, +); diff --git a/src/routes/v2/pages/Editor/hooks/useHistoryWindow.tsx b/src/routes/v2/pages/Editor/hooks/useHistoryWindow.tsx index a9f96ff05..0457cff34 100644 --- a/src/routes/v2/pages/Editor/hooks/useHistoryWindow.tsx +++ b/src/routes/v2/pages/Editor/hooks/useHistoryWindow.tsx @@ -1,6 +1,7 @@ import { useEffect } from "react"; import { HistoryContent } from "@/routes/v2/pages/Editor/components/HistoryContent/HistoryContent"; +import { HistoryWindowMiniContent } from "@/routes/v2/pages/Editor/components/HistoryContent/HistoryWindowMiniContent"; import { useSharedStores } from "@/routes/v2/shared/store/SharedStoreContext"; const HISTORY_WINDOW_ID = "history"; @@ -17,6 +18,7 @@ export function useHistoryWindow() { disabledActions: ["close"], persisted: true, defaultDockState: "left", + miniContent: , }); } }, [windows]);