feat: Added table cell menu for adding/removing rows and columns to Super note tables and merging cells (#2508)

This commit is contained in:
Aman Harwara
2023-09-16 15:14:20 +05:30
committed by GitHub
parent 2ff120d29c
commit 896372f04d
4 changed files with 611 additions and 33 deletions

View File

@@ -5,22 +5,23 @@ import { classNames } from '@standardnotes/utils'
import StyledTooltip from '../StyledTooltip/StyledTooltip'
type Props = {
onClick: () => void
onClick: MouseEventHandler
className?: string
icon: IconType
iconClassName?: string
iconProps?: Partial<Parameters<typeof Icon>[0]>
label: string
id?: string
} & ComponentPropsWithoutRef<'button'>
const RoundIconButton = forwardRef(
(
{ onClick, className, icon: iconType, iconClassName, id, label, ...props }: Props,
{ onClick, className, icon: iconType, iconClassName, iconProps, id, label, ...props }: Props,
ref: ForwardedRef<HTMLButtonElement>,
) => {
const click: MouseEventHandler = (e) => {
e.preventDefault()
onClick()
onClick(e)
}
return (
<StyledTooltip label={label}>
@@ -37,7 +38,7 @@ const RoundIconButton = forwardRef(
aria-label={label}
{...props}
>
<Icon type={iconType} className={iconClassName} />
<Icon {...iconProps} type={iconType} className={iconClassName} />
</button>
</StyledTooltip>
)