From 58c6efc5c86d31ed96a9b9bc30a9c0fc6423d892 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Tue, 31 Jan 2023 07:54:31 +0100 Subject: [PATCH] :fire: Remove inline edit in old engine --- .../ChatGroup/ChatBlock/InputChatBlock.tsx | 6 ------ .../ChatGroup/ChatBlock/bubbles/GuestBubble.tsx | 14 -------------- 2 files changed, 20 deletions(-) diff --git a/packages/bot-engine/src/components/ChatGroup/ChatBlock/InputChatBlock.tsx b/packages/bot-engine/src/components/ChatGroup/ChatBlock/InputChatBlock.tsx index d0d555d69..1b05d154b 100644 --- a/packages/bot-engine/src/components/ChatGroup/ChatBlock/InputChatBlock.tsx +++ b/packages/bot-engine/src/components/ChatGroup/ChatBlock/InputChatBlock.tsx @@ -63,11 +63,6 @@ export const InputChatBlock = ({ setIsEditting(false) } - const handleGuestBubbleClick = () => { - setAnswer(undefined) - setIsEditting(true) - } - if (isLoading) return null if (answer) { @@ -77,7 +72,6 @@ export const InputChatBlock = ({ message={answer} showAvatar={typebot.theme.chat.guestAvatar?.isEnabled ?? false} avatarSrc={avatarUrl && parseVariables(typebot.variables)(avatarUrl)} - onClick={handleGuestBubbleClick} /> ) } diff --git a/packages/bot-engine/src/components/ChatGroup/ChatBlock/bubbles/GuestBubble.tsx b/packages/bot-engine/src/components/ChatGroup/ChatBlock/bubbles/GuestBubble.tsx index a0aea2980..bf433ead0 100644 --- a/packages/bot-engine/src/components/ChatGroup/ChatBlock/bubbles/GuestBubble.tsx +++ b/packages/bot-engine/src/components/ChatGroup/ChatBlock/bubbles/GuestBubble.tsx @@ -6,33 +6,19 @@ interface Props { message: string showAvatar: boolean avatarSrc?: string - onClick: () => void } export const GuestBubble = ({ message, showAvatar, avatarSrc, - onClick, }: Props): JSX.Element => { const [content] = useState(message) - const [isDragging, setIsDragging] = useState(false) - - const handleMouseDown = () => setIsDragging(false) - const handleMouseMove = () => setIsDragging(true) - const handleMouseUp = () => { - setIsDragging(false) - if (isDragging) return - onClick() - } return (