diff --git a/ui2/src/features/document/components/Contextmenu.tsx b/ui2/src/features/document/components/Contextmenu.tsx new file mode 100644 index 000000000..e5fe89985 --- /dev/null +++ b/ui2/src/features/document/components/Contextmenu.tsx @@ -0,0 +1,89 @@ +import {useAppSelector} from "@/app/hooks" +import type {Coord} from "@/types" +import {Box, Menu, rem} from "@mantine/core" +import { + IconEdit, + IconRotate, + IconRotateClockwise, + IconTrash, + IconX +} from "@tabler/icons-react" +import {useContext} from "react" + +import PanelContext from "@/contexts/PanelContext" +import {selectSelectedPages} from "@/features/document/documentVersSlice" +import type {PanelMode} from "@/types" + +interface Args { + opened: boolean + onChange: (opened: boolean) => void + position: Coord +} + +export default function ContextMenu({position, opened, onChange}: Args) { + const mode: PanelMode = useContext(PanelContext) + const selectedPages = useAppSelector(s => selectSelectedPages(s, mode)) || [] + + return ( +
+ ) +} diff --git a/ui2/src/features/document/components/Viewer.tsx b/ui2/src/features/document/components/Viewer.tsx index 2b23da4bf..99b464f68 100644 --- a/ui2/src/features/document/components/Viewer.tsx +++ b/ui2/src/features/document/components/Viewer.tsx @@ -7,15 +7,19 @@ import {useNavigate} from "react-router-dom" import Breadcrumbs from "@/components/Breadcrumbs" import PanelContext from "@/contexts/PanelContext" import {useGetDocumentQuery} from "@/features/document/apiSlice" +import {useRef, useState} from "react" +import {HIDDEN} from "@/cconstants" import { currentDocVerUpdated, currentNodeChanged, selectContentHeight, selectCurrentNodeID } from "@/features/ui/uiSlice" -import type {NType, PanelMode} from "@/types" +import type {Coord, NType, PanelMode} from "@/types" +import {useDisclosure} from "@mantine/hooks" import ActionButtons from "./ActionButtons" +import ContextMenu from "./Contextmenu" import PagesHaveChangedDialog from "./PageHaveChangedDialog" import Pages from "./Pages" import Thumbnails from "./Thumbnails" @@ -23,6 +27,9 @@ import ThumbnailsToggle from "./ThumbnailsToggle" import classes from "./Viewer.module.css" export default function Viewer() { + const ref = useRef