mirror of
https://github.com/outline/outline.git
synced 2026-12-04 10:24:43 +03:00
Revoking a share link now operates on every active share, so it can be performed from the bulk selection toolbar as well as the row menu. The copy link and go to source actions read their share from the action context too, and hide when a multi-selection is active. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
32 lines
899 B
TypeScript
32 lines
899 B
TypeScript
import { observer } from "mobx-react";
|
|
import * as React from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import type Share from "~/models/Share";
|
|
import { DropdownMenu } from "~/components/Menu/DropdownMenu";
|
|
import { OverflowMenuButton } from "~/components/Menu/OverflowMenuButton";
|
|
import { ActionContextProvider } from "~/hooks/useActionContext";
|
|
import { useShareMenuActions } from "~/hooks/useShareMenuActions";
|
|
|
|
type Props = {
|
|
share: Share;
|
|
};
|
|
|
|
function ShareMenu({ share }: Props) {
|
|
const { t } = useTranslation();
|
|
const rootAction = useShareMenuActions();
|
|
|
|
return (
|
|
<ActionContextProvider value={{ activeModels: [share] }}>
|
|
<DropdownMenu
|
|
action={rootAction}
|
|
align="end"
|
|
ariaLabel={t("Share options")}
|
|
>
|
|
<OverflowMenuButton />
|
|
</DropdownMenu>
|
|
</ActionContextProvider>
|
|
);
|
|
}
|
|
|
|
export default observer(ShareMenu);
|