feat: Add 'Rename…' option to collection menu
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
ExportIcon,
|
||||
AlphabeticalSortIcon,
|
||||
ManualSortIcon,
|
||||
InputIcon,
|
||||
} from "outline-icons";
|
||||
import * as React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -38,6 +39,7 @@ type Props = {
|
||||
placement?: Placement;
|
||||
modal?: boolean;
|
||||
label?: (props: MenuButtonHTMLProps) => React.ReactNode;
|
||||
onRename?: () => void;
|
||||
onOpen?: () => void;
|
||||
onClose?: () => void;
|
||||
};
|
||||
@@ -47,6 +49,7 @@ function CollectionMenu({
|
||||
label,
|
||||
modal = true,
|
||||
placement,
|
||||
onRename,
|
||||
onOpen,
|
||||
onClose,
|
||||
}: Props) {
|
||||
@@ -166,6 +169,13 @@ function CollectionMenu({
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
title: `${t("Rename")}…`,
|
||||
visible: !!can.update && !!onRename,
|
||||
onClick: () => onRename?.(),
|
||||
icon: <InputIcon />,
|
||||
},
|
||||
actionToMenuItem(editCollection, context),
|
||||
actionToMenuItem(editCollectionPermissions, context),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user