From 786908e9cfbf1b1f3673ff14de58312e0ff29dcd Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Tue, 5 Apr 2022 11:32:23 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=99=BF=EF=B8=8F=20Getting=20started?= =?UTF-8?q?=20editor=20modal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/editor/GettingStartedModal.tsx | 79 ++++++++++++++++ .../templates/CreateNewTypebotButtons.tsx | 47 ++++------ .../components/templates/TemplateButton.tsx | 92 ------------------- apps/builder/layouts/editor/Board.tsx | 36 -------- .../pages/typebots/[typebotId]/edit.tsx | 58 +++++++++--- 5 files changed, 141 insertions(+), 171 deletions(-) create mode 100644 apps/builder/components/editor/GettingStartedModal.tsx delete mode 100644 apps/builder/components/templates/TemplateButton.tsx delete mode 100644 apps/builder/layouts/editor/Board.tsx 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) +