mirror of
https://github.com/outline/outline.git
synced 2026-11-29 00:29:36 +03:00
* feat: Expiry column and expiry menu for shared links Adds an Expires column to the shared links table and a Set expiry submenu with presets, a custom date dialog and removal. Also loads document memberships in shares.list so the update policy is correct. * fix: Hide share expiry menu when workspace sharing is disabled * refactor: Load share document memberships in the list query
31 lines
693 B
TypeScript
31 lines
693 B
TypeScript
import { useMemo } from "react";
|
|
import { ActionSeparator } from "~/actions";
|
|
import {
|
|
copyShareUrl,
|
|
goToShareSource,
|
|
revokeShare,
|
|
setShareExpiry,
|
|
} from "~/actions/definitions/shares";
|
|
import { useMenuAction } from "~/hooks/useMenuAction";
|
|
|
|
/**
|
|
* Hook that constructs the action menu for share management operations. The
|
|
* share is read from the active models in the action context.
|
|
*
|
|
* @returns action with children for use in menus.
|
|
*/
|
|
export function useShareMenuActions() {
|
|
const actions = useMemo(
|
|
() => [
|
|
copyShareUrl,
|
|
goToShareSource,
|
|
setShareExpiry,
|
|
ActionSeparator,
|
|
revokeShare,
|
|
],
|
|
[]
|
|
);
|
|
|
|
return useMenuAction(actions);
|
|
}
|