diff --git a/apps/builder/components/editor/GettingStartedModal.tsx b/apps/builder/components/editor/GettingStartedModal.tsx
new file mode 100644
index 000000000..78c6508f6
--- /dev/null
+++ b/apps/builder/components/editor/GettingStartedModal.tsx
@@ -0,0 +1,79 @@
+import {
+ useDisclosure,
+ Modal,
+ ModalOverlay,
+ ModalContent,
+ ModalCloseButton,
+ ModalBody,
+ Stack,
+ Heading,
+ List,
+ ListItem,
+ ListIcon,
+ Text,
+} from '@chakra-ui/react'
+import { CheckSquareIcon } from 'assets/icons'
+import { useRouter } from 'next/router'
+import { useEffect } from 'react'
+
+export const GettingStartedModal = () => {
+ const { query } = useRouter()
+ const { isOpen, onOpen, onClose } = useDisclosure()
+
+ useEffect(() => {
+ if (query.isFirstBot) onOpen()
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [])
+
+ return (
+
+
+
+
+
+
+ Editor basics
+
+
+
+ The left side bar contains blocks that you can drag and drop to
+ the canva
+
+
+
+ You can group blocks together by dragging them below or above
+ each other
+
+
+
+ Don't forget to connect blocks together
+
+
+
+ Preview your bot by clicking the preview button on the right
+
+
+
+
+
+ Feel free to use the bottom-right bubble to contact if you have any
+ question 😃
+
+
+ See it in action ({`<`} 5 minutes)
+
+
+
+
+
+ )
+}
diff --git a/apps/builder/components/templates/CreateNewTypebotButtons.tsx b/apps/builder/components/templates/CreateNewTypebotButtons.tsx
index 9fcd34d35..537b10ce4 100644
--- a/apps/builder/components/templates/CreateNewTypebotButtons.tsx
+++ b/apps/builder/components/templates/CreateNewTypebotButtons.tsx
@@ -2,7 +2,6 @@ import {
VStack,
Heading,
Stack,
- Tooltip,
Button,
useDisclosure,
useToast,
@@ -11,7 +10,7 @@ import { ToolIcon, TemplateIcon, DownloadIcon } from 'assets/icons'
import { useUser } from 'contexts/UserContext'
import { Typebot } from 'models'
import { useRouter } from 'next/router'
-import React, { useEffect, useState } from 'react'
+import React, { useState } from 'react'
import { importTypebot, createTypebot } from 'services/typebots'
import { ImportTypebotFromFileButton } from './ImportTypebotFromFileButton'
import { TemplatesModal } from './TemplatesModal'
@@ -20,8 +19,6 @@ export const CreateNewTypebotButtons = () => {
const { user } = useUser()
const router = useRouter()
const { isOpen, onOpen, onClose } = useDisclosure()
- const [isFromScratchTooltipOpened, setIsFromScratchTooltipOpened] =
- useState(false)
const [isLoading, setIsLoading] = useState(false)
@@ -31,13 +28,6 @@ export const CreateNewTypebotButtons = () => {
title: 'An error occured',
})
- useEffect(() => {
- if (!router.isReady) return
- const isFirstBot = router.query.isFirstBot as string | undefined
- if (isFirstBot) setIsFromScratchTooltipOpened(true)
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [router.isReady])
-
const handleCreateSubmit = async (typebot?: Typebot) => {
if (!user) return
setIsLoading(true)
@@ -62,7 +52,11 @@ export const CreateNewTypebotButtons = () => {
folderId,
})
if (error) toast({ description: error.message })
- if (data) router.push(`/typebots/${data.id}/edit`)
+ if (data)
+ router.push({
+ pathname: `/typebots/${data.id}/edit`,
+ query: { isFirstBot: router.query.isFirstBot },
+ })
setIsLoading(false)
}
@@ -70,26 +64,17 @@ export const CreateNewTypebotButtons = () => {
Create a new typebot
- }
+ onClick={() => handleCreateSubmit()}
+ isLoading={isLoading}
>
- }
- onClick={() => handleCreateSubmit()}
- isLoading={isLoading}
- >
- Start from scratch
-
-
+ Start from scratch
+