diff --git a/src/components/Controls.jsx b/src/components/Controls.jsx new file mode 100644 index 0000000..ad5c853 --- /dev/null +++ b/src/components/Controls.jsx @@ -0,0 +1,57 @@ +import { Divider, Tooltip } from "@douyinfe/semi-ui"; +import { exitFullscreen } from "../utils"; +import useTransform from "../hooks/useTransform"; +import useLayout from "../hooks/useLayout"; + +export default function Controls() { + const { transform, setTransform } = useTransform(); + const { setLayout } = useLayout(); + + return ( +
+
+ + +
{parseInt(transform.zoom * 100)}%
+ + +
+ + + +
+ ); +} diff --git a/src/context/UndoRedoContext.jsx b/src/context/UndoRedoContext.jsx index de9aaf6..bee4f31 100644 --- a/src/context/UndoRedoContext.jsx +++ b/src/context/UndoRedoContext.jsx @@ -5,6 +5,7 @@ export const UndoRedoContext = createContext(null); export default function UndoRedoContextProvider({ children }) { const [undoStack, setUndoStack] = useState([]); const [redoStack, setRedoStack] = useState([]); + return ( {!(layout.sidebar || layout.toolbar || layout.header) && ( -
-
- - -
- {parseInt(transform.zoom * 100)}% -
- - -
- - - +
+
)}