| @@ -1,5 +1,5 @@ | ||
| 1 | -import React, { Fragment, useEffect } from 'react'; | |
| 1 | +import { Fragment, useEffect } from 'react'; | |
| 2 | 2 | import { portalId } from '../../constants/leadinConfig'; |
| 3 | 3 | import UISpacer from '../UIComponents/UISpacer'; |
| 4 | 4 | import PreviewForm from './PreviewForm'; |
| 5 | 5 | import FormSelect from './FormSelect'; |
| @@ -5,14 +5,13 @@ | ||
| 5 | 5 | import FormSelect from './FormSelect'; |
| 6 | 6 | import { IFormBlockProps } from '../../gutenberg/FormBlock/registerFormBlock'; |
| 7 | 7 | import { |
| 8 | 8 | usePostBackgroundMessage, |
| 9 | - BackgroudAppContext, | |
| 10 | 9 | useBackgroundAppContext, |
| 11 | 10 | } from '../../iframe/useBackgroundApp'; |
| 12 | 11 | import { ProxyMessages } from '../../iframe/integratedMessages'; |
| 13 | 12 | import LoadingBlock from '../Common/LoadingBlock'; |
| 14 | -import { useGetEmbedder } from '../../utils/useGetEmbedder'; | |
| 13 | +import EmbedderContainer from '../Common/EmbedderContainer'; | |
| 15 | 14 | |
| 16 | 15 | interface IFormEditProps extends IFormBlockProps { |
| 17 | 16 | preview: boolean; |
| 18 | 17 | origin: 'gutenberg' | 'elementor'; |
| @@ -85,20 +84,10 @@ | ||
| 85 | 84 | ); |
| 86 | 85 | } |
| 87 | 86 | |
| 88 | 87 | export default function FormEditContainer(props: IFormEditProps) { |
| 89 | - const { embedder, errorElement, isLoading } = useGetEmbedder(); | |
| 90 | - | |
| 91 | - if (errorElement) { | |
| 92 | - return errorElement; | |
| 93 | - } | |
| 94 | - | |
| 95 | - if (isLoading) { | |
| 96 | - return <LoadingBlock />; | |
| 97 | - } | |
| 98 | - | |
| 99 | 88 | return ( |
| 100 | - <BackgroudAppContext.Provider value={embedder}> | |
| 89 | + <EmbedderContainer> | |
| 101 | 90 | <FormEdit {...props} /> |
| 102 | - </BackgroudAppContext.Provider> | |
| 91 | + </EmbedderContainer> | |
| 103 | 92 | ); |
| 104 | 93 | } |