2
0

🐛 (usage) Archive typebot to be able to compute usage

This commit is contained in:
Baptiste Arnaud
2022-10-01 08:36:49 +02:00
committed by Baptiste Arnaud
parent 75ca255af2
commit 15dbc9577d
20 changed files with 152 additions and 84 deletions

View File

@ -26,6 +26,7 @@ import { useWorkspace } from 'contexts/WorkspaceContext'
import { EmojiOrImageIcon } from 'components/shared/EmojiOrImageIcon'
import { WorkspaceSettingsModal } from './WorkspaceSettingsModal'
import { isNotDefined } from 'utils'
import { PlanTag } from 'components/shared/PlanTag'
export const DashboardHeader = () => {
const { user } = useUser()
@ -90,9 +91,13 @@ export const DashboardHeader = () => {
/>
</SkeletonCircle>
{workspace && (
<>
<Text noOfLines={1} maxW="200px">
{workspace.name}
</Text>
<PlanTag plan={workspace.plan}/>
</>
)}
<ChevronLeftIcon transform="rotate(-90deg)" />
</HStack>
@ -112,6 +117,7 @@ export const DashboardHeader = () => {
defaultIcon={HardDriveIcon}
/>
<Text>{workspace.name}</Text>
<PlanTag plan={workspace.plan}/>
</HStack>
</MenuItem>
))}

View File

@ -1,10 +1,10 @@
import { Button, HStack, useDisclosure, Text } from '@chakra-ui/react'
import { FolderPlusIcon } from 'assets/icons'
import { LockTag } from 'components/shared/LockTag'
import {
LimitReached,
ChangePlanModal,
} from 'components/shared/modals/ChangePlanModal'
import { PlanTag } from 'components/shared/PlanTag'
import { useWorkspace } from 'contexts/WorkspaceContext'
import { Plan } from 'db'
import React from 'react'
@ -28,7 +28,7 @@ export const CreateFolderButton = ({ isLoading, onClick }: Props) => {
>
<HStack>
<Text>Create a folder</Text>
{isFreePlan(workspace) && <PlanTag plan={Plan.STARTER} />}
{isFreePlan(workspace) && <LockTag plan={Plan.STARTER} />}
</HStack>
<ChangePlanModal
isOpen={isOpen}

View File

@ -46,7 +46,7 @@ export const CurrentSubscriptionContent = ({
return (
<Stack gap="2">
<Heading fontSize="3xl">Subscription</Heading>
<HStack>
<HStack data-testid="current-subscription">
<Text>Current workspace subscription: </Text>
{isCancelling ? (
<Spinner color="gray.500" size="xs" />