Files
outline/app/menus/TrashMenu.tsx
T
Tom MoorandClaude Opus 5 a1925983c1 Dismissable invite and import onboarding links in sidebar (#13292)
* feat: Dismissable invite and import links in sidebar

Adds a dismissable "Import docs" link to the sidebar for new workspaces and
allows the existing invite link to be hidden with a cross on hover, persisted
locally. Also moves "Empty trash" into an overflow menu on the trash page.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Hide dropdown menu trigger when no items are visible

Adds a lightweight visibility resolver so DropdownMenu renders nothing when
none of its actions apply, avoiding an overflow trigger that opens an empty
menu — for example "Empty trash" for non-admins.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 01:20:21 +00:00

23 lines
751 B
TypeScript

import { observer } from "mobx-react";
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { DropdownMenu } from "~/components/Menu/DropdownMenu";
import { OverflowMenuButton } from "~/components/Menu/OverflowMenuButton";
import { permanentlyDeleteDocumentsInTrash } from "~/actions/definitions/documents";
import { useMenuAction } from "~/hooks/useMenuAction";
function TrashMenu() {
const { t } = useTranslation();
const actions = useMemo(() => [permanentlyDeleteDocumentsInTrash], []);
const rootAction = useMenuAction(actions);
return (
<DropdownMenu action={rootAction} ariaLabel={t("Trash options")}>
<OverflowMenuButton />
</DropdownMenu>
);
}
export default observer(TrashMenu);