diff --git a/libs/components/editor-blocks/src/blocks/group/components/Panel.tsx b/libs/components/editor-blocks/src/blocks/group/components/Panel.tsx index b9557ba7a8..e8faba84a1 100644 --- a/libs/components/editor-blocks/src/blocks/group/components/Panel.tsx +++ b/libs/components/editor-blocks/src/blocks/group/components/Panel.tsx @@ -1,33 +1,25 @@ import { styled } from '@toeverything/components/ui'; -import type { ReactNode, MouseEvent, CSSProperties } from 'react'; +import type { ComponentPropsWithRef, MouseEvent } from 'react'; +import { forwardRef } from 'react'; -const StyledPanel = styled('div')<{ extraStyle?: CSSProperties }>( - ({ extraStyle }) => ({ - position: 'absolute', - top: 50, - background: '#FFFFFF', - boxShadow: '0px 1px 10px rgba(152, 172, 189, 0.6)', - borderRadius: 10, - padding: '12px 24px', - ...extraStyle, - }) +const StyledPanel = styled('div')(() => ({ + position: 'absolute', + top: 50, + background: '#FFFFFF', + boxShadow: '0px 1px 10px rgba(152, 172, 189, 0.6)', + borderRadius: 10, + padding: '12px 24px', +})); + +const Panel = forwardRef>( + ({ onClick, ...rest }, ref) => { + const stopPropagation = (e: MouseEvent) => { + onClick?.(e); + e.stopPropagation(); + }; + + return ; + } ); -const Panel = ({ - children, - extraStyle, -}: { - children: ReactNode; - extraStyle?: CSSProperties; -}) => { - const stopPropagation = (e: MouseEvent) => - e.stopPropagation(); - - return ( - - {children} - - ); -}; - export { Panel }; diff --git a/libs/components/editor-blocks/src/blocks/group/components/group-by/GroupBy.tsx b/libs/components/editor-blocks/src/blocks/group/components/group-by/GroupBy.tsx index 9ac3bff713..475157b082 100644 --- a/libs/components/editor-blocks/src/blocks/group/components/group-by/GroupBy.tsx +++ b/libs/components/editor-blocks/src/blocks/group/components/group-by/GroupBy.tsx @@ -62,7 +62,7 @@ const GroupBy = ({ closePanel }: { closePanel: () => void }) => { }; return ( - +
COLUMN
diff --git a/libs/components/editor-blocks/src/blocks/group/components/sorter/Sorter.tsx b/libs/components/editor-blocks/src/blocks/group/components/sorter/Sorter.tsx index 4fba8c9520..0ee2b3f994 100644 --- a/libs/components/editor-blocks/src/blocks/group/components/sorter/Sorter.tsx +++ b/libs/components/editor-blocks/src/blocks/group/components/sorter/Sorter.tsx @@ -24,7 +24,7 @@ const Sorter = ({ }; return ( - +