2
0

chore(editor): 👔 Send email disabled in preview

This commit is contained in:
Baptiste Arnaud
2022-02-13 07:49:56 +01:00
parent f57827c530
commit f8a64151ef
7 changed files with 41 additions and 10 deletions

View File

@ -31,7 +31,8 @@ export const ChatBlock = ({
onScroll,
onBlockEnd,
}: ChatBlockProps) => {
const { typebot, updateVariableValue, createEdge, apiHost } = useTypebot()
const { typebot, updateVariableValue, createEdge, apiHost, isPreview } =
useTypebot()
const [displayedSteps, setDisplayedSteps] = useState<PublicStep[]>([])
const currentStepIndex = displayedSteps.length - 1
@ -67,6 +68,7 @@ export const ChatBlock = ({
typebotId: typebot.id,
indices: { blockIndex, stepIndex: currentStepIndex },
variables: typebot.variables,
isPreview,
updateVariableValue,
},
})

View File

@ -14,6 +14,7 @@ import { Answer, BackgroundType, Edge, PublicTypebot } from 'models'
export type TypebotViewerProps = {
typebot: PublicTypebot
isPreview?: boolean
apiHost?: string
onNewBlockVisible?: (edge: Edge) => void
onNewAnswer?: (answer: Answer) => void
@ -22,6 +23,7 @@ export type TypebotViewerProps = {
export const TypebotViewer = ({
typebot,
apiHost = process.env.NEXT_PUBLIC_VIEWER_HOST,
isPreview = false,
onNewBlockVisible,
onNewAnswer,
onCompleted,
@ -66,7 +68,7 @@ export const TypebotViewer = ({
}:wght@300;400;600&display=swap');`,
}}
/>
<TypebotContext typebot={typebot} apiHost={apiHost}>
<TypebotContext typebot={typebot} apiHost={apiHost} isPreview={isPreview}>
<AnswersContext>
<div
className="flex text-base overflow-hidden bg-cover h-screen w-screen flex-col items-center typebot-container"