Skip to content

Commit

Permalink
馃泜 Disable direct support for Free users
Browse files Browse the repository at this point in the history
Closes #1318
  • Loading branch information
baptisteArno committed Mar 4, 2024
1 parent daaca9f commit 6d8a007
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 5 deletions.
3 changes: 3 additions & 0 deletions apps/builder/src/components/SupportBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
import React, { useEffect, useState } from 'react'
import { Bubble, BubbleProps } from '@typebot.io/nextjs'
import { planToReadable } from '@/features/billing/helpers/planToReadable'
import { Plan } from '@typebot.io/prisma'

export const SupportBubble = (props: Omit<BubbleProps, 'typebot'>) => {
const { typebot } = useTypebot()
Expand All @@ -18,6 +19,8 @@ export const SupportBubble = (props: Omit<BubbleProps, 'typebot'>) => {
setLastViewedTypebotId(typebot?.id)
}, [lastViewedTypebotId, typebot?.id])

if (workspace?.plan && workspace.plan !== Plan.FREE) return null

return (
<Bubble
typebot="typebot-support"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const StarterPlanPricingCard = ({
t('billing.pricingCard.starter.brandingRemoved'),
t('billing.pricingCard.starter.fileUploadBlock'),
t('billing.pricingCard.starter.createFolders'),
'Direct priority support',
]}
/>
</Stack>
Expand Down
4 changes: 4 additions & 0 deletions apps/builder/src/features/editor/components/EditorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { GraphDndProvider } from '@/features/graph/providers/GraphDndProvider'
import { GraphProvider } from '@/features/graph/providers/GraphProvider'
import { EventsCoordinatesProvider } from '@/features/graph/providers/EventsCoordinateProvider'
import { TypebotNotFoundPage } from './TypebotNotFoundPage'
import { SuspectedTypebotBanner } from './SuspectedTypebotBanner'

export const EditorPage = () => {
const { typebot, currentUserMode, is404 } = useTypebot()
Expand All @@ -31,6 +32,9 @@ export const EditorPage = () => {
<Seo title={typebot?.name ? `${typebot.name} | Editor` : 'Editor'} />
<Flex overflow="clip" h="100vh" flexDir="column" id="editor-container">
<GettingStartedModal />
{typebot?.riskLevel === 100 && (
<SuspectedTypebotBanner typebotId={typebot.id} />
)}
<TypebotHeader />
<Flex
flex="1"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { TextLink } from '@/components/TextLink'
import { useUser } from '@/features/account/hooks/useUser'
import { HStack, Text } from '@chakra-ui/react'

type Props = {
typebotId: string
}
export const SuspectedTypebotBanner = ({ typebotId }: Props) => {
const { user } = useUser()

if (!user?.email) return null

return (
<HStack
bgColor="red.500"
w="full"
zIndex={1000}
color="white"
justifyContent="center"
fontSize="sm"
textAlign="center"
py="2"
>
<Text fontWeight="bold">
Our anti-scam system flagged your typebot. It is currently being
reviewed manually.
<br />
If you think that&apos;s a mistake,{' '}
<TextLink
href={`https://typebot.co/claim-non-scam?Email=${encodeURIComponent(
user.email
)}&typebotId=${typebotId}`}
>
contact us
</TextLink>
.
</Text>
</HStack>
)
}
7 changes: 5 additions & 2 deletions apps/builder/src/features/editor/components/TypebotHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { isCloudProdInstance } from '@/helpers/isCloudProdInstance'
import { useTranslate } from '@tolgee/react'
import { GuestTypebotHeader } from './UnauthenticatedTypebotHeader'
import { useKeyboardShortcuts } from '@/hooks/useKeyboardShortcuts'
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
import { Plan } from '@typebot.io/prisma'

export const TypebotHeader = () => {
const { t } = useTranslate()
Expand All @@ -49,6 +51,7 @@ export const TypebotHeader = () => {
isSavingLoading,
currentUserMode,
} = useTypebot()
const { workspace } = useWorkspace()
const {
setRightPanel,
rightPanel,
Expand Down Expand Up @@ -99,9 +102,9 @@ export const TypebotHeader = () => {
})

const handleHelpClick = () => {
isCloudProdInstance()
isCloudProdInstance() && workspace?.plan && workspace.plan !== Plan.FREE
? onOpen()
: window.open('https://docs.typebot.io', '_blank')
: window.open('https://docs.typebot.io/guides/how-to-get-help', '_blank')
}

if (currentUserMode === 'guest') return <GuestTypebotHeader />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { parseDefaultPublicId } from '../helpers/parseDefaultPublicId'
import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/constants'
import { ConfirmModal } from '@/components/ConfirmModal'
import { TextLink } from '@/components/TextLink'
import { useUser } from '@/features/account/hooks/useUser'
import { useTimeSince } from '@/hooks/useTimeSince'

type Props = ButtonProps & {
Expand All @@ -45,7 +44,6 @@ export const PublishButton = ({
const { workspace } = useWorkspace()
const { push, query, pathname } = useRouter()
const { isOpen, onOpen, onClose } = useDisclosure()
const { logOut } = useUser()
const {
isOpen: isNewEngineWarningOpen,
onOpen: onNewEngineWarningOpen,
Expand Down Expand Up @@ -79,7 +77,6 @@ export const PublishButton = ({
title: t('publish.error.label'),
description: error.message,
})
if (error.data?.httpStatus === 403) logOut()
},
onSuccess: () => {
refetchPublishedTypebot({
Expand Down
20 changes: 20 additions & 0 deletions apps/docs/guides/how-to-get-help.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: How to get help?
---

Here is what you should do if you have an issue or even a question (this list is ordered by chronological time-to-resolution):

1. Read this documentation. I do my best to keep it up to date and to cover all the possible issues and questions. Use the search bar to find what you are looking for.
2. You can ask for help or report your bug in the [Discord community](https://typebot.io/discord). Specifically in the `#help-and-questions` channel. I try to answer all the questions there daily. There is also a good chance that someone else has already asked the same question and you can find the answer there using the search bar.
3. Users subscribed to the `Starter` or `Pro` plan can directly reach out to me through the chat widget in the bottom right corner of the app.

<Note>
I'm working on a AI-powered typebot that will be able to answer most of the
questions. It's not ready yet but it's coming soon.
</Note>

## If this is urgent

An urgent request is something that is causing a major issue for you or your business in relation to Typebot in production.

If that is the case, report it [here](https://typebot.co/urgent-support).
1 change: 1 addition & 0 deletions apps/docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
{
"group": "Guides",
"pages": [
"guides/how-to-get-help",
"guides/mailer-lite",
"guides/multi-avatars",
"guides/rtl",
Expand Down
1 change: 1 addition & 0 deletions apps/landing-page/components/PricingPage/FreePlanCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const FreePlanCard = () => (
'Native integrations',
'Webhooks',
'Custom Javascript & CSS',
'Community support & Docs',
],
}}
button={
Expand Down
22 changes: 22 additions & 0 deletions apps/landing-page/components/PricingPage/PlanComparisonTables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,28 @@ export const PlanComparisonTables = ({ onChatsTiersClick }: Props) => (
</Tr>
</Thead>
<Tbody>
<Tr>
<Td>Community support</Td>
<Td>
<CheckIcon />
</Td>
<Td>
<CheckIcon />
</Td>
<Td>
<CheckIcon />
</Td>
</Tr>
<Tr>
<Td>Direct support channel</Td>
<Td />
<Td>
<CheckIcon />
</Td>
<Td>
<CheckIcon />
</Td>
</Tr>
<Tr>
<Td>Priority support</Td>
<Td />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const StarterPlanCard = () => {
'Branding removed',
'Collect files from users',
'Create folders',
'Direct priority support',
],
}}
borderWidth="1px"
Expand Down

0 comments on commit 6d8a007

Please sign in to comment.