Skip to content

Commit

Permalink
🐛 Fix theme background and font default selection
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Nov 9, 2023
1 parent a38467e commit e9a10c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export const ThemeTemplateCard = ({
}

const hostBubbleBgColor =
themeTemplate.theme.chat?.hostBubbles ?? defaultTheme.chat.hostBubbles
themeTemplate.theme.chat?.hostBubbles?.backgroundColor ??
defaultTheme.chat.hostBubbles.backgroundColor

const guestAvatar = {
isEnabled:
Expand All @@ -84,7 +85,8 @@ export const ThemeTemplateCard = ({
}

const guestBubbleBgColor =
themeTemplate.theme.chat?.guestBubbles ?? defaultTheme.chat.guestBubbles
themeTemplate.theme.chat?.guestBubbles?.backgroundColor ??
defaultTheme.chat.guestBubbles.backgroundColor

const buttonBgColor =
themeTemplate.theme.chat?.buttons?.backgroundColor ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { isFreePlan } from '@/features/billing/helpers/isFreePlan'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
import { ChangePlanModal } from '@/features/billing/components/ChangePlanModal'
import { useTranslate } from '@tolgee/react'
import { defaultTheme } from '@typebot.io/schemas/features/typebot/theme/constants'

type Props = {
isBrandingEnabled: boolean
Expand Down Expand Up @@ -62,11 +63,11 @@ export const GeneralSettings = ({
/>
</Flex>
<FontSelector
activeFont={generalTheme?.font}
activeFont={generalTheme?.font ?? defaultTheme.general.font}
onSelectFont={handleSelectFont}
/>
<BackgroundSelector
background={generalTheme?.background}
background={generalTheme?.background ?? defaultTheme.general.background}
onBackgroundChange={handleBackgroundChange}
/>
</Stack>
Expand Down

0 comments on commit e9a10c0

Please sign in to comment.