diff --git a/app/client/src/components/designSystems/blueprint/IframeComponent.tsx b/app/client/src/components/designSystems/blueprint/IframeComponent.tsx index 7e7444c283..3d161cf6ab 100644 --- a/app/client/src/components/designSystems/blueprint/IframeComponent.tsx +++ b/app/client/src/components/designSystems/blueprint/IframeComponent.tsx @@ -3,6 +3,9 @@ import styled from "styled-components"; import { ComponentProps } from "components/designSystems/appsmith/BaseComponent"; import { hexToRgba } from "components/ads/common"; +import { AppState } from "reducers"; +import { useSelector } from "store"; +import { RenderMode, RenderModes } from "constants/WidgetConstants"; interface IframeContainerProps { borderColor?: string; @@ -11,6 +14,7 @@ interface IframeContainerProps { } export const IframeContainer = styled.div` + position: relative; display: flex; align-items: center; justify-content: center; @@ -34,7 +38,16 @@ export const IframeContainer = styled.div` } `; +const OverlayDiv = styled.div` + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +`; + export interface IframeComponentProps extends ComponentProps { + renderMode: RenderMode; source: string; title?: string; onURLChanged: (url: string) => void; @@ -51,8 +64,10 @@ function IframeComponent(props: IframeComponentProps) { borderWidth, onMessageReceived, onURLChanged, + renderMode, source, title, + widgetId, } = props; const [message, setMessage] = useState(""); @@ -74,12 +89,24 @@ function IframeComponent(props: IframeComponentProps) { } }, [source]); + const isPropertyPaneVisible = useSelector( + (state: AppState) => state.ui.propertyPane.isVisible, + ); + const selectedWidgetId = useSelector( + (state: AppState) => state.ui.propertyPane.widgetId, + ); + return ( + {renderMode === RenderModes.CANVAS && + !(isPropertyPaneVisible && widgetId === selectedWidgetId) && ( + + )} + {message ? message :