chore(dashboard): 💄 Remove v2 annoucements
This commit is contained in:
@ -6,14 +6,13 @@ import {
|
|||||||
Portal,
|
Portal,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Stack,
|
Stack,
|
||||||
useDisclosure,
|
|
||||||
useEventListener,
|
useEventListener,
|
||||||
useToast,
|
useToast,
|
||||||
Wrap,
|
Wrap,
|
||||||
} from '@chakra-ui/react'
|
} from '@chakra-ui/react'
|
||||||
import { useTypebotDnd } from 'contexts/TypebotDndContext'
|
import { useTypebotDnd } from 'contexts/TypebotDndContext'
|
||||||
import { useUser } from 'contexts/UserContext'
|
import { useUser } from 'contexts/UserContext'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { createFolder, useFolders } from 'services/folders'
|
import { createFolder, useFolders } from 'services/folders'
|
||||||
import {
|
import {
|
||||||
patchTypebot,
|
patchTypebot,
|
||||||
@ -21,7 +20,6 @@ import {
|
|||||||
useTypebots,
|
useTypebots,
|
||||||
} from 'services/typebots'
|
} from 'services/typebots'
|
||||||
import { useSharedTypebotsCount } from 'services/user/sharedTypebots'
|
import { useSharedTypebotsCount } from 'services/user/sharedTypebots'
|
||||||
import { AnnoucementModal } from './annoucements/AnnoucementModal'
|
|
||||||
import { BackButton } from './FolderContent/BackButton'
|
import { BackButton } from './FolderContent/BackButton'
|
||||||
import { CreateBotButton } from './FolderContent/CreateBotButton'
|
import { CreateBotButton } from './FolderContent/CreateBotButton'
|
||||||
import { CreateFolderButton } from './FolderContent/CreateFolderButton'
|
import { CreateFolderButton } from './FolderContent/CreateFolderButton'
|
||||||
@ -51,7 +49,6 @@ export const FolderContent = ({ folder }: Props) => {
|
|||||||
})
|
})
|
||||||
const [typebotDragCandidate, setTypebotDragCandidate] =
|
const [typebotDragCandidate, setTypebotDragCandidate] =
|
||||||
useState<TypebotInDashboard>()
|
useState<TypebotInDashboard>()
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure()
|
|
||||||
|
|
||||||
const toast = useToast({
|
const toast = useToast({
|
||||||
position: 'top-right',
|
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) => {
|
const moveTypebotToFolder = async (typebotId: string, folderId: string) => {
|
||||||
if (!typebots) return
|
if (!typebots) return
|
||||||
const { error } = await patchTypebot(typebotId, {
|
const { error } = await patchTypebot(typebotId, {
|
||||||
@ -178,7 +163,6 @@ export const FolderContent = ({ folder }: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex w="full" flex="1" justify="center">
|
<Flex w="full" flex="1" justify="center">
|
||||||
<AnnoucementModal isOpen={isOpen} onClose={onClose} />
|
|
||||||
<Stack w="1000px" spacing={6}>
|
<Stack w="1000px" spacing={6}>
|
||||||
<Skeleton isLoaded={folder?.name !== undefined}>
|
<Skeleton isLoaded={folder?.name !== undefined}>
|
||||||
<Heading as="h1">{folder?.name}</Heading>
|
<Heading as="h1">{folder?.name}</Heading>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
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 { DashboardHeader } from 'components/dashboard/DashboardHeader'
|
||||||
import { Seo } from 'components/Seo'
|
import { Seo } from 'components/Seo'
|
||||||
import { FolderContent } from 'components/dashboard/FolderContent'
|
import { FolderContent } from 'components/dashboard/FolderContent'
|
||||||
@ -9,12 +9,10 @@ import { redeemCoupon } from 'services/coupons'
|
|||||||
import { Spinner, useToast } from '@chakra-ui/react'
|
import { Spinner, useToast } from '@chakra-ui/react'
|
||||||
import { pay } from 'services/stripe'
|
import { pay } from 'services/stripe'
|
||||||
import { useUser } from 'contexts/UserContext'
|
import { useUser } from 'contexts/UserContext'
|
||||||
import { Banner } from 'components/dashboard/annoucements/AnnoucementBanner'
|
|
||||||
import { NextPageContext } from 'next/types'
|
import { NextPageContext } from 'next/types'
|
||||||
|
|
||||||
const DashboardPage = () => {
|
const DashboardPage = () => {
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
const [showBanner, setShowBanner] = useState(false)
|
|
||||||
const { query, isReady } = useRouter()
|
const { query, isReady } = useRouter()
|
||||||
const { user } = useUser()
|
const { user } = useUser()
|
||||||
const toast = useToast({
|
const toast = useToast({
|
||||||
@ -38,9 +36,6 @@ const DashboardPage = () => {
|
|||||||
const couponCode = query.coupon?.toString()
|
const couponCode = query.coupon?.toString()
|
||||||
const stripeStatus = query.stripe?.toString()
|
const stripeStatus = query.stripe?.toString()
|
||||||
|
|
||||||
if (document.location.hostname.includes('app.typebot.io'))
|
|
||||||
setShowBanner(true)
|
|
||||||
|
|
||||||
if (stripeStatus === 'success')
|
if (stripeStatus === 'success')
|
||||||
toast({
|
toast({
|
||||||
title: 'Typebot Pro',
|
title: 'Typebot Pro',
|
||||||
@ -57,16 +52,6 @@ const DashboardPage = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack minH="100vh">
|
<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" />
|
<Seo title="My typebots" />
|
||||||
<DashboardHeader />
|
<DashboardHeader />
|
||||||
<TypebotDndContext>
|
<TypebotDndContext>
|
||||||
|
Reference in New Issue
Block a user