2
0

🔥 Remove inline edit in old engine

This commit is contained in:
Baptiste Arnaud
2023-01-31 07:54:31 +01:00
parent 2bcccd4afa
commit 58c6efc5c8
2 changed files with 0 additions and 20 deletions

View File

@ -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}
/>
)
}

View File

@ -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 (
<CSSTransition classNames="bubble" timeout={1000}>
<div
className="flex justify-end mb-2 items-end"
onMouseDown={handleMouseDown}
onMouseMove={handleMouseMove}
onMouseUp={handleMouseUp}
style={{ marginLeft: '50px' }}
>
<span