2
0

🐛 Fix theme background and font default selection

This commit is contained in:
Baptiste Arnaud
2023-11-09 15:12:48 +01:00
parent a38467e5b2
commit e9a10c078f
2 changed files with 7 additions and 4 deletions

View File

@@ -74,7 +74,8 @@ export const ThemeTemplateCard = ({
} }
const hostBubbleBgColor = const hostBubbleBgColor =
themeTemplate.theme.chat?.hostBubbles ?? defaultTheme.chat.hostBubbles themeTemplate.theme.chat?.hostBubbles?.backgroundColor ??
defaultTheme.chat.hostBubbles.backgroundColor
const guestAvatar = { const guestAvatar = {
isEnabled: isEnabled:
@@ -84,7 +85,8 @@ export const ThemeTemplateCard = ({
} }
const guestBubbleBgColor = const guestBubbleBgColor =
themeTemplate.theme.chat?.guestBubbles ?? defaultTheme.chat.guestBubbles themeTemplate.theme.chat?.guestBubbles?.backgroundColor ??
defaultTheme.chat.guestBubbles.backgroundColor
const buttonBgColor = const buttonBgColor =
themeTemplate.theme.chat?.buttons?.backgroundColor ?? themeTemplate.theme.chat?.buttons?.backgroundColor ??

View File

@@ -9,6 +9,7 @@ import { isFreePlan } from '@/features/billing/helpers/isFreePlan'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider' import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
import { ChangePlanModal } from '@/features/billing/components/ChangePlanModal' import { ChangePlanModal } from '@/features/billing/components/ChangePlanModal'
import { useTranslate } from '@tolgee/react' import { useTranslate } from '@tolgee/react'
import { defaultTheme } from '@typebot.io/schemas/features/typebot/theme/constants'
type Props = { type Props = {
isBrandingEnabled: boolean isBrandingEnabled: boolean
@@ -62,11 +63,11 @@ export const GeneralSettings = ({
/> />
</Flex> </Flex>
<FontSelector <FontSelector
activeFont={generalTheme?.font} activeFont={generalTheme?.font ?? defaultTheme.general.font}
onSelectFont={handleSelectFont} onSelectFont={handleSelectFont}
/> />
<BackgroundSelector <BackgroundSelector
background={generalTheme?.background} background={generalTheme?.background ?? defaultTheme.general.background}
onBackgroundChange={handleBackgroundChange} onBackgroundChange={handleBackgroundChange}
/> />
</Stack> </Stack>