🚸 (dashboard) Add unpublish menu item in dashboard

Also remove the useless publishedTypebotId field in Typebot

Closes #232
This commit is contained in:
Baptiste Arnaud
2023-01-27 17:11:26 +01:00
parent a842f57297
commit f93bc2fcb2
59 changed files with 212 additions and 90 deletions

View File

@@ -18,7 +18,7 @@ import { RightPanel, useEditor } from '../../providers/EditorProvider'
import { useTypebot } from '../../providers/TypebotProvider'
import { useRouter } from 'next/router'
import React, { useState } from 'react'
import { isNotDefined } from 'utils'
import { isDefined, isNotDefined } from 'utils'
import { EditableTypebotName } from './EditableTypebotName'
import { getBubbleActions } from 'typebot-js'
import Link from 'next/link'
@@ -34,6 +34,7 @@ export const TypebotHeader = () => {
const router = useRouter()
const {
typebot,
publishedTypebot,
updateTypebot,
save,
undo,
@@ -126,7 +127,7 @@ export const TypebotHeader = () => {
>
Share
</Button>
{typebot?.publishedTypebotId && (
{isDefined(publishedTypebot) && (
<Button
as={Link}
href={`/typebots/${typebot?.id}/results`}