Skip to content

Commit

Permalink
perf: 🚸 Make guest bubble selectable
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jun 14, 2022
1 parent 5c54bb7 commit 9b8b27b
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,27 @@ export const GuestBubble = ({
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"
onClick={onClick}
onMouseDown={handleMouseDown}
onMouseMove={handleMouseMove}
onMouseUp={handleMouseUp}
style={{ marginLeft: '50px' }}
>
<span
className="px-4 py-2 rounded-lg mr-2 whitespace-pre-wrap max-w-full typebot-guest-bubble cursor-pointer hover:brightness-90 active:brightness-75"
className="px-4 py-2 rounded-lg mr-2 whitespace-pre-wrap max-w-full typebot-guest-bubble cursor-pointer"
data-testid="guest-bubble"
>
{content}
Expand Down

4 comments on commit 9b8b27b

@vercel
Copy link

@vercel vercel bot commented on 9b8b27b Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 9b8b27b Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 9b8b27b Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 9b8b27b Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.