diff --git a/frontend/src/Editor/Components/Modal.jsx b/frontend/src/Editor/Components/Modal.jsx index dcf5356dc4..0c9853c749 100644 --- a/frontend/src/Editor/Components/Modal.jsx +++ b/frontend/src/Editor/Components/Modal.jsx @@ -1,5 +1,5 @@ import React, { useRef, useState, useEffect } from 'react'; -import { default as BootstrapModal} from 'react-bootstrap/Modal'; +import { default as BootstrapModal } from 'react-bootstrap/Modal'; import Button from 'react-bootstrap/Button'; import { SubCustomDragLayer } from '../SubCustomDragLayer'; import { SubContainer } from '../SubContainer'; @@ -10,10 +10,15 @@ export const Modal = function Modal({ height, containerProps }) { - const [show, showModal] = useState(false); const parentRef = useRef(null); + const titleProp = component.definition.properties.title; + const title = titleProp ? titleProp.value : ''; + + const sizeProp = component.definition.properties.size; + const size = sizeProp ? sizeProp.value : 'lg'; + useEffect(() => { const componentState = containerProps.currentState.components[component.name]; const canShowModel = componentState ? componentState.show : false; @@ -27,19 +32,21 @@ export const Modal = function Modal({ return (
- containerProps.onComponentClick(id, component)} onEscapeKeyDown={() => showModal(false)} > - + + {title} +
- + -