2
0

feat(viewer): Add variables in URL support

This commit is contained in:
Baptiste Arnaud
2022-02-17 10:46:04 +01:00
parent f7d6f0b766
commit 6e0ab67502
15 changed files with 550 additions and 58 deletions

View File

@ -13,8 +13,16 @@ export const headerHeight = 56
export const TypebotHeader = () => {
const router = useRouter()
const { typebot, updateOnBothTypebots, save, undo, redo, canUndo, canRedo } =
useTypebot()
const {
typebot,
updateOnBothTypebots,
save,
undo,
redo,
canUndo,
canRedo,
publishedTypebot,
} = useTypebot()
const { setRightPanel } = useEditor()
const handleBackClick = async () => {
@ -77,14 +85,16 @@ export const TypebotHeader = () => {
>
Share
</Button>
<Button
as={NextChakraLink}
href={`/typebots/${typebot?.id}/results`}
colorScheme={router.pathname.includes('results') ? 'blue' : 'gray'}
variant={router.pathname.includes('results') ? 'outline' : 'ghost'}
>
Results
</Button>
{typebot?.publishedTypebotId && (
<Button
as={NextChakraLink}
href={`/typebots/${typebot?.id}/results`}
colorScheme={router.pathname.includes('results') ? 'blue' : 'gray'}
variant={router.pathname.includes('results') ? 'outline' : 'ghost'}
>
Results
</Button>
)}
</HStack>
<Flex pos="absolute" left="1rem" justify="center" align="center">
<HStack alignItems="center">