Add "turn into" option in block context menu

Closes #1302
This commit is contained in:
Baptiste Arnaud
2024-03-05 15:46:28 +01:00
parent 84d6c594af
commit 2fb379b102
16 changed files with 244 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ import {
export interface ContextMenuProps<T extends HTMLElement> {
onOpen?: () => void
renderMenu: () => JSX.Element | null
renderMenu: ({ onClose }: { onClose: () => void }) => JSX.Element | null
children: (
ref: MutableRefObject<T | null>,
isOpened: boolean
@@ -101,7 +101,7 @@ export function ContextMenu<T extends HTMLElement = HTMLElement>(
}}
{...props.menuButtonProps}
/>
{props.renderMenu()}
{props.renderMenu({ onClose: onCloseHandler })}
</Menu>
</Portal>
)}

View File

@@ -662,3 +662,12 @@ export const UnlinkIcon = (props: IconProps) => (
<line x1="19" x2="22" y1="16" y2="16" />
</Icon>
)
export const RepeatIcon = (props: IconProps) => (
<Icon viewBox="0 0 24 24" {...featherIconsBaseProps} {...props}>
<path d="m2 9 3-3 3 3" />
<path d="M13 18H7a2 2 0 0 1-2-2V6" />
<path d="m22 15-3 3-3-3" />
<path d="M11 6h6a2 2 0 0 1 2 2v10" />
</Icon>
)