feat: right-click to open menu for document/collection links

This commit is contained in:
2024-05-30 00:36:25 +08:00
parent 43cf33fc0a
commit eaea7b043e
6 changed files with 56 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ type Props = {
collection: Collection;
placement?: Placement;
modal?: boolean;
visible?: boolean;
label?: (props: MenuButtonHTMLProps) => React.ReactNode;
onRename?: () => void;
onOpen?: () => void;
@@ -50,6 +51,7 @@ function CollectionMenu({
collection,
label,
modal = true,
visible,
placement,
onRename,
onOpen,
@@ -65,6 +67,12 @@ function CollectionMenu({
const history = useHistory();
const file = React.useRef<HTMLInputElement>(null);
React.useEffect(() => {
if (visible !== undefined && menu.visible !== visible) {
menu.setVisible(visible);
}
}, [visible]);
const handleExport = React.useCallback(() => {
dialogs.openModal({
title: t("Export collection"),