From 64bafd15a1af6a925efd142dc9b31872e7ad3599 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Fri, 18 Mar 2022 11:39:02 +0100 Subject: [PATCH] =?UTF-8?q?chore(dashboard):=20=F0=9F=92=84=20Remove=20v2?= =?UTF-8?q?=20annoucements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dashboard/FolderContent.tsx | 18 +----------------- apps/builder/pages/typebots.tsx | 17 +---------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/apps/builder/components/dashboard/FolderContent.tsx b/apps/builder/components/dashboard/FolderContent.tsx index 69c54a907..67d8c8e7f 100644 --- a/apps/builder/components/dashboard/FolderContent.tsx +++ b/apps/builder/components/dashboard/FolderContent.tsx @@ -6,14 +6,13 @@ import { Portal, Skeleton, Stack, - useDisclosure, useEventListener, useToast, Wrap, } from '@chakra-ui/react' import { useTypebotDnd } from 'contexts/TypebotDndContext' import { useUser } from 'contexts/UserContext' -import React, { useEffect, useState } from 'react' +import React, { useState } from 'react' import { createFolder, useFolders } from 'services/folders' import { patchTypebot, @@ -21,7 +20,6 @@ import { useTypebots, } from 'services/typebots' import { useSharedTypebotsCount } from 'services/user/sharedTypebots' -import { AnnoucementModal } from './annoucements/AnnoucementModal' import { BackButton } from './FolderContent/BackButton' import { CreateBotButton } from './FolderContent/CreateBotButton' import { CreateFolderButton } from './FolderContent/CreateFolderButton' @@ -51,7 +49,6 @@ export const FolderContent = ({ folder }: Props) => { }) const [typebotDragCandidate, setTypebotDragCandidate] = useState() - const { isOpen, onOpen, onClose } = useDisclosure() const toast = useToast({ position: 'top-right', @@ -89,18 +86,6 @@ export const FolderContent = ({ folder }: Props) => { }, }) - useEffect(() => { - if ( - typebots && - typebots.length === 0 && - folders && - folders.length === 0 && - folder?.id === undefined - ) - onOpen() - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [typebots, folders, folder]) - const moveTypebotToFolder = async (typebotId: string, folderId: string) => { if (!typebots) return const { error } = await patchTypebot(typebotId, { @@ -178,7 +163,6 @@ export const FolderContent = ({ folder }: Props) => { return ( - {folder?.name} diff --git a/apps/builder/pages/typebots.tsx b/apps/builder/pages/typebots.tsx index 91a37032f..f4939eab0 100644 --- a/apps/builder/pages/typebots.tsx +++ b/apps/builder/pages/typebots.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react' -import { Link, Stack, Text, VStack } from '@chakra-ui/layout' +import { Stack, Text, VStack } from '@chakra-ui/layout' import { DashboardHeader } from 'components/dashboard/DashboardHeader' import { Seo } from 'components/Seo' import { FolderContent } from 'components/dashboard/FolderContent' @@ -9,12 +9,10 @@ import { redeemCoupon } from 'services/coupons' import { Spinner, useToast } from '@chakra-ui/react' import { pay } from 'services/stripe' import { useUser } from 'contexts/UserContext' -import { Banner } from 'components/dashboard/annoucements/AnnoucementBanner' import { NextPageContext } from 'next/types' const DashboardPage = () => { const [isLoading, setIsLoading] = useState(false) - const [showBanner, setShowBanner] = useState(false) const { query, isReady } = useRouter() const { user } = useUser() const toast = useToast({ @@ -38,9 +36,6 @@ const DashboardPage = () => { const couponCode = query.coupon?.toString() const stripeStatus = query.stripe?.toString() - if (document.location.hostname.includes('app.typebot.io')) - setShowBanner(true) - if (stripeStatus === 'success') toast({ title: 'Typebot Pro', @@ -57,16 +52,6 @@ const DashboardPage = () => { return ( - {showBanner && ( - - - You are on Typebot 2.0. To access the old version, navigate to - - - https://old.typebot.io - - - )}