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) setIsEditting(false)
} }
const handleGuestBubbleClick = () => {
setAnswer(undefined)
setIsEditting(true)
}
if (isLoading) return null if (isLoading) return null
if (answer) { if (answer) {
@ -77,7 +72,6 @@ export const InputChatBlock = ({
message={answer} message={answer}
showAvatar={typebot.theme.chat.guestAvatar?.isEnabled ?? false} showAvatar={typebot.theme.chat.guestAvatar?.isEnabled ?? false}
avatarSrc={avatarUrl && parseVariables(typebot.variables)(avatarUrl)} avatarSrc={avatarUrl && parseVariables(typebot.variables)(avatarUrl)}
onClick={handleGuestBubbleClick}
/> />
) )
} }

View File

@ -6,33 +6,19 @@ interface Props {
message: string message: string
showAvatar: boolean showAvatar: boolean
avatarSrc?: string avatarSrc?: string
onClick: () => void
} }
export const GuestBubble = ({ export const GuestBubble = ({
message, message,
showAvatar, showAvatar,
avatarSrc, avatarSrc,
onClick,
}: Props): JSX.Element => { }: Props): JSX.Element => {
const [content] = useState(message) 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 ( return (
<CSSTransition classNames="bubble" timeout={1000}> <CSSTransition classNames="bubble" timeout={1000}>
<div <div
className="flex justify-end mb-2 items-end" className="flex justify-end mb-2 items-end"
onMouseDown={handleMouseDown}
onMouseMove={handleMouseMove}
onMouseUp={handleMouseUp}
style={{ marginLeft: '50px' }} style={{ marginLeft: '50px' }}
> >
<span <span