diff --git a/frontend/src/components/board-card/BoardCard.tsx b/frontend/src/components/board-card/BoardCard.tsx index bae4c191..b5b5a4dc 100644 --- a/frontend/src/components/board-card/BoardCard.tsx +++ b/frontend/src/components/board-card/BoardCard.tsx @@ -38,6 +38,7 @@ const BoardCard: FC = ({ handleFavoriteClick, registerDropdown, closeDropdown, + handleDoubleClick, } = useBoardCard(card); const { t } = useTranslation("magneto"); @@ -126,6 +127,7 @@ const BoardCard: FC = ({ zoomLevel={zoomLevel} isDragging={isDragging} ref={setNodeRef} + onDoubleClick={handleDoubleClick} style={style} {...(readOnly ? {} : { ...attributes, ...listeners })} > diff --git a/frontend/src/hooks/useBoardCard.ts b/frontend/src/hooks/useBoardCard.ts index c28167cc..2763401e 100644 --- a/frontend/src/hooks/useBoardCard.ts +++ b/frontend/src/hooks/useBoardCard.ts @@ -25,6 +25,7 @@ export const useBoardCard = (card: Card) => { hasManageRights, activeCard, closeActiveCardAction, + openActiveCardAction, } = useBoard(); const { user } = useUser(); const { openDropdownId, registerDropdown, toggleDropdown, closeDropdown } = @@ -87,6 +88,14 @@ export const useBoardCard = (card: Card) => { } }, [card.id, toggleDropdown]); + const handleDoubleClick = useCallback( + (e: React.MouseEvent) => { + e.stopPropagation(); + openActiveCardAction(card, BOARD_MODAL_TYPE.CARD_PREVIEW); + }, + [card], + ); + const handleDropdownClose = useCallback(() => { toggleDropdown(null); }, [toggleDropdown]); @@ -109,6 +118,7 @@ export const useBoardCard = (card: Card) => { handleFavoriteClick, registerDropdown, closeDropdown, + handleDoubleClick, }), [ icon, @@ -122,6 +132,7 @@ export const useBoardCard = (card: Card) => { handleFavoriteClick, registerDropdown, closeDropdown, + handleDoubleClick, ], ); };