feat: right-click to open menu for document/collection links
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user