2
0

🦴 Add share page backbone

This commit is contained in:
Baptiste Arnaud
2021-12-23 15:20:21 +01:00
parent 79aede1f3f
commit 9a78a341d2
12 changed files with 217 additions and 4 deletions

View File

@ -0,0 +1,35 @@
import { Flex, Heading, Stack } from '@chakra-ui/react'
import { useTypebot } from 'contexts/TypebotContext'
import React from 'react'
import { parseDefaultPublicId } from 'services/typebots'
import { EditableUrl } from './EditableUrl'
export const ShareContent = () => {
const { typebot, updatePublicId } = useTypebot()
const handlePublicIdChange = (publicId: string) => {
if (publicId === typebot?.publicId) return
updatePublicId(publicId)
}
return (
<Flex h="full" w="full" justifyContent="center" align="flex-start">
<Stack maxW="1000px" w="full" pt="10" spacing={6}>
<Heading fontSize="2xl" as="h1">
Your typebot link
</Heading>
{typebot && (
<EditableUrl
publicId={
typebot?.publicId ??
parseDefaultPublicId(typebot.name, typebot.id)
}
onPublicIdChange={handlePublicIdChange}
/>
)}
<Heading fontSize="2xl" as="h1">
Embed your typebot
</Heading>
</Stack>
</Flex>
)
}