🐛 (share) Fix bubble button default background in embed modals
Closes #1165
This commit is contained in:
@ -15,7 +15,7 @@ export const IframeSnippet = ({ widthLabel, heightLabel }: Props) => {
|
||||
const { typebot } = useTypebot()
|
||||
const src = `${env.NEXT_PUBLIC_VIEWER_URL[0]}/${typebot?.publicId}`
|
||||
const code = prettier.format(
|
||||
`<iframe src="${src}" style="border: none; width=${widthLabel}; height=${heightLabel}"></iframe>`,
|
||||
`<iframe src="${src}" style="border: none; width: ${widthLabel}; height: ${heightLabel}"></iframe>`,
|
||||
{ parser: 'html', plugins: [parserHtml] }
|
||||
)
|
||||
|
||||
|
@ -5,10 +5,13 @@ import { Typebot } from '@typebot.io/schemas'
|
||||
import { useState } from 'react'
|
||||
import { BubbleSettings } from '../../../settings/BubbleSettings/BubbleSettings'
|
||||
import { JavascriptBubbleSnippet } from '../JavascriptBubbleSnippet'
|
||||
import { defaultTheme } from '@typebot.io/schemas/features/typebot/theme/constants'
|
||||
|
||||
export const parseDefaultBubbleTheme = (typebot?: Typebot) => ({
|
||||
button: {
|
||||
backgroundColor: typebot?.theme.chat?.buttons?.backgroundColor,
|
||||
backgroundColor:
|
||||
typebot?.theme.chat?.buttons?.backgroundColor ??
|
||||
defaultTheme.chat.buttons.backgroundColor,
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -2,7 +2,6 @@ import { CodeEditor } from '@/components/inputs/CodeEditor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { Stack, Text } from '@chakra-ui/react'
|
||||
import { BubbleProps } from '@typebot.io/nextjs'
|
||||
import { Typebot } from '@typebot.io/schemas'
|
||||
import { useState } from 'react'
|
||||
import { BubbleSettings } from '../../../settings/BubbleSettings/BubbleSettings'
|
||||
import {
|
||||
@ -11,16 +10,7 @@ import {
|
||||
typebotImportCode,
|
||||
parseApiHostValue,
|
||||
} from '../../../snippetParsers'
|
||||
|
||||
export const parseDefaultBubbleTheme = (typebot?: Typebot) => ({
|
||||
button: {
|
||||
backgroundColor: typebot?.theme.chat?.buttons?.backgroundColor,
|
||||
iconColor: typebot?.theme.chat?.buttons?.color,
|
||||
},
|
||||
previewMessage: {
|
||||
backgroundColor: typebot?.theme.general?.background?.content,
|
||||
},
|
||||
})
|
||||
import { parseDefaultBubbleTheme } from '../../Javascript/instructions/JavascriptBubbleInstructions'
|
||||
|
||||
export const ScriptBubbleInstructions = () => {
|
||||
const { typebot } = useTypebot()
|
||||
|
Reference in New Issue
Block a user