fix(editor): 🚑️ Preview panel not showing
This commit is contained in:
@ -1,7 +1,11 @@
|
|||||||
import { Flex } from '@chakra-ui/layout'
|
import { Flex } from '@chakra-ui/layout'
|
||||||
import { Seo } from 'components/Seo'
|
import { Seo } from 'components/Seo'
|
||||||
import { TypebotHeader } from 'components/shared/TypebotHeader'
|
import { TypebotHeader } from 'components/shared/TypebotHeader'
|
||||||
import { EditorContext, RightPanel, useEditor } from 'contexts/EditorContext'
|
import {
|
||||||
|
EditorContext,
|
||||||
|
RightPanel as RightPanelEnum,
|
||||||
|
useEditor,
|
||||||
|
} from 'contexts/EditorContext'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { KBar } from 'components/shared/KBar'
|
import { KBar } from 'components/shared/KBar'
|
||||||
import { BoardMenuButton } from 'components/editor/BoardMenuButton'
|
import { BoardMenuButton } from 'components/editor/BoardMenuButton'
|
||||||
@ -15,7 +19,6 @@ import { GettingStartedModal } from 'components/editor/GettingStartedModal'
|
|||||||
|
|
||||||
const TypebotEditPage = () => {
|
const TypebotEditPage = () => {
|
||||||
const { typebot, isReadOnly } = useTypebot()
|
const { typebot, isReadOnly } = useTypebot()
|
||||||
const { rightPanel } = useEditor()
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EditorContext>
|
<EditorContext>
|
||||||
@ -41,7 +44,7 @@ const TypebotEditPage = () => {
|
|||||||
>
|
>
|
||||||
{typebot && <Graph flex="1" typebot={typebot} />}
|
{typebot && <Graph flex="1" typebot={typebot} />}
|
||||||
<BoardMenuButton pos="absolute" right="40px" top="20px" />
|
<BoardMenuButton pos="absolute" right="40px" top="20px" />
|
||||||
{rightPanel === RightPanel.PREVIEW && <PreviewDrawer />}
|
<RightPanel />
|
||||||
</GraphProvider>
|
</GraphProvider>
|
||||||
</GraphDndContext>
|
</GraphDndContext>
|
||||||
</Flex>
|
</Flex>
|
||||||
@ -50,4 +53,9 @@ const TypebotEditPage = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const RightPanel = () => {
|
||||||
|
const { rightPanel } = useEditor()
|
||||||
|
return rightPanel === RightPanelEnum.PREVIEW ? <PreviewDrawer /> : <></>
|
||||||
|
}
|
||||||
|
|
||||||
export default TypebotEditPage
|
export default TypebotEditPage
|
||||||
|
Reference in New Issue
Block a user