2
0

🐛 (js) Fix container color when empty

This commit is contained in:
Baptiste Arnaud
2023-07-06 16:00:41 +02:00
parent 5a05310a9c
commit aeb62f968a
3 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.0.65",
"version": "0.0.66",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",

View File

@ -8,6 +8,7 @@ import {
} from '@typebot.io/schemas'
import { BackgroundType } from '@typebot.io/schemas/features/typebot/theme/enums'
import { isLight, hexToRgb } from '@typebot.io/lib/hexToRgb'
import { isNotEmpty } from '@typebot.io/lib'
const cssVariableNames = {
general: {
@ -37,6 +38,7 @@ const cssVariableNames = {
},
checkbox: {
bgColor: '--typebot-checkbox-bg-color',
color: '--typebot-checkbox-color',
},
},
} as const
@ -155,7 +157,9 @@ const setTypebotBackground = (
parseBackgroundValue(background)
)
const backgroundColor =
(BackgroundType.COLOR ? background.content : '#ffffff') ?? '#ffffff'
(BackgroundType.COLOR && isNotEmpty(background.content)
? background.content
: '#ffffff') ?? '#ffffff'
documentStyle.setProperty(
cssVariableNames.chat.checkbox.bgColor,
(BackgroundType.COLOR ? background.content : '#ffffff') ?? '#ffffff'

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.0.65",
"version": "0.0.66",
"description": "React library to display typebots on your website",
"main": "dist/index.js",
"types": "dist/index.d.ts",