2
0

feat(dashboard): Add lead generation template

While creating the template I also made sure to fix and improve everything I stumble upon
This commit is contained in:
Baptiste Arnaud
2022-02-07 07:13:16 +01:00
parent 524ef0812c
commit 1f320c5d99
20 changed files with 397 additions and 46 deletions

View File

@@ -16,7 +16,7 @@ import {
} from 'models'
import { useGraph } from 'contexts/GraphContext'
import { StepIcon } from 'components/editor/StepsSideBar/StepIcon'
import { isBubbleStep, isTextBubbleStep, stepHasItems } from 'utils'
import { isBubbleStep, isTextBubbleStep } from 'utils'
import { StepNodeContent } from './StepNodeContent/StepNodeContent'
import { useTypebot } from 'contexts/TypebotContext'
import { ContextMenu } from 'components/shared/ContextMenu'
@@ -53,6 +53,9 @@ export const StepNode = ({
const [isPopoverOpened, setIsPopoverOpened] = useState(
openedStepId === step.id
)
const [isEditing, setIsEditing] = useState<boolean>(
isTextBubbleStep(step) && step.content.plainText === ''
)
const stepRef = useRef<HTMLDivElement | null>(null)
const onDrag = (position: NodePosition) => {
@@ -65,9 +68,6 @@ export const StepNode = ({
isDisabled: !onMouseDown || step.type === 'start',
})
const [isEditing, setIsEditing] = useState<boolean>(
isTextBubbleStep(step) && step.content.plainText === ''
)
const {
isOpen: isModalOpen,
onOpen: onModalOpen,