Skip to content

Commit

Permalink
chore(dashboard): 💄 Remove v2 annoucements
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Mar 18, 2022
1 parent 89ac0f8 commit 64bafd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 33 deletions.
18 changes: 1 addition & 17 deletions apps/builder/components/dashboard/FolderContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@ 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,
TypebotInDashboard,
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'
Expand Down Expand Up @@ -51,7 +49,6 @@ export const FolderContent = ({ folder }: Props) => {
})
const [typebotDragCandidate, setTypebotDragCandidate] =
useState<TypebotInDashboard>()
const { isOpen, onOpen, onClose } = useDisclosure()

const toast = useToast({
position: 'top-right',
Expand Down Expand Up @@ -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, {
Expand Down Expand Up @@ -178,7 +163,6 @@ export const FolderContent = ({ folder }: Props) => {

return (
<Flex w="full" flex="1" justify="center">
<AnnoucementModal isOpen={isOpen} onClose={onClose} />
<Stack w="1000px" spacing={6}>
<Skeleton isLoaded={folder?.name !== undefined}>
<Heading as="h1">{folder?.name}</Heading>
Expand Down
17 changes: 1 addition & 16 deletions apps/builder/pages/typebots.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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({
Expand All @@ -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',
Expand All @@ -57,16 +52,6 @@ const DashboardPage = () => {

return (
<Stack minH="100vh">
{showBanner && (
<Banner id={'v1-navigation'}>
<Text>
You are on Typebot 2.0. To access the old version, navigate to
</Text>
<Link href="https://old.typebot.io" isExternal textDecor="underline">
https://old.typebot.io
</Link>
</Banner>
)}
<Seo title="My typebots" />
<DashboardHeader />
<TypebotDndContext>
Expand Down

0 comments on commit 64bafd1

Please sign in to comment.