♻️ Normalize data
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Flex, Text } from '@chakra-ui/react'
|
||||
import { Background, BackgroundType } from 'bot-engine'
|
||||
import { Background, BackgroundType } from 'models'
|
||||
import React from 'react'
|
||||
import { ColorPicker } from '../ColorPicker'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Stack, Text } from '@chakra-ui/react'
|
||||
import { Background, BackgroundType } from 'bot-engine'
|
||||
import { Background, BackgroundType } from 'models'
|
||||
import { deepEqual } from 'fast-equals'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { BackgroundContent } from './BackgroundContent'
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
useRadioGroup,
|
||||
UseRadioProps,
|
||||
} from '@chakra-ui/react'
|
||||
import { BackgroundType } from 'bot-engine'
|
||||
import { BackgroundType } from 'models'
|
||||
import { ReactNode } from 'react'
|
||||
|
||||
type Props = {
|
||||
|
@ -8,28 +8,32 @@ import {
|
||||
Stack,
|
||||
} from '@chakra-ui/react'
|
||||
import { PencilIcon } from 'assets/icons'
|
||||
import { Background } from 'bot-engine'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { Background } from 'models'
|
||||
import { useTypebot } from 'contexts/TypebotContext/TypebotContext'
|
||||
import React from 'react'
|
||||
import { BackgroundSelector } from './BackgroundSelector'
|
||||
import { FontSelector } from './FontSelector'
|
||||
|
||||
export const GeneralContent = () => {
|
||||
const { typebot, updateTheme } = useTypebot()
|
||||
const { typebot, updateTypebot } = useTypebot()
|
||||
|
||||
const handleSelectFont = (font: string) => {
|
||||
if (!typebot) return
|
||||
updateTheme({
|
||||
...typebot.theme,
|
||||
general: { ...typebot.theme.general, font },
|
||||
updateTypebot({
|
||||
theme: {
|
||||
...typebot.theme,
|
||||
general: { ...typebot.theme.general, font },
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const handleBackgroundChange = (background: Background) => {
|
||||
if (!typebot) return
|
||||
updateTheme({
|
||||
...typebot.theme,
|
||||
general: { ...typebot.theme.general, background },
|
||||
updateTypebot({
|
||||
theme: {
|
||||
...typebot.theme,
|
||||
general: { ...typebot.theme.general, background },
|
||||
},
|
||||
})
|
||||
}
|
||||
return (
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Flex } from '@chakra-ui/react'
|
||||
import { TypebotViewer } from 'bot-engine'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { useTypebot } from 'contexts/TypebotContext/TypebotContext'
|
||||
import React, { useMemo } from 'react'
|
||||
import { parseTypebotToPublicTypebot } from 'services/publicTypebot'
|
||||
import { SideMenu } from './SideMenu'
|
||||
|
Reference in New Issue
Block a user