Skip to content

Commit

Permalink
feat(engine): ♿️ Add data-block-name prop
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Mar 29, 2022
1 parent f7d12dc commit 023a6f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/bot-engine/src/components/ChatBlock/ChatBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { getLastChatStepType } from '../../services/chat'
type ChatBlockProps = {
steps: Step[]
startStepIndex: number
blockTitle: string
onScroll: () => void
onBlockEnd: (
edgeId?: string,
Expand All @@ -36,6 +37,7 @@ type ChatDisplayChunk = { bubbles: BubbleStep[]; input?: InputStep }
export const ChatBlock = ({
steps,
startStepIndex,
blockTitle,
onScroll,
onBlockEnd,
}: ChatBlockProps) => {
Expand Down Expand Up @@ -167,7 +169,7 @@ export const ChatBlock = ({
const avatarSrc = typebot.theme.chat.hostAvatar?.url

return (
<div className="flex w-full">
<div className="flex w-full" data-block-name={blockTitle}>
<div className="flex flex-col w-full min-w-0">
{displayedChunks.map((chunk, idx) => (
<ChatChunks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const ConversationContainer = ({
startStepIndex={displayedBlock.startStepIndex}
onScroll={autoScrollToBottom}
onBlockEnd={displayNextBlock}
blockTitle={displayedBlock.block.title}
/>
))}
{/* We use a block to simulate padding because it makes iOS scroll flicker */}
Expand Down

3 comments on commit 023a6f2

@vercel
Copy link

@vercel vercel bot commented on 023a6f2 Mar 29, 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 023a6f2 Mar 29, 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 023a6f2 Mar 29, 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

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

Please sign in to comment.