From 1f717f391b96a88186c897b9b886e11d6168c87c Mon Sep 17 00:00:00 2001 From: Thomas Zemp Date: Mon, 1 Jul 2024 12:19:13 +0200 Subject: [PATCH] fix: fixed dimensions plugins [LIBS-634] (#858) --- shell/src/PluginLoader.js | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/shell/src/PluginLoader.js b/shell/src/PluginLoader.js index 426fca57..bec41c23 100644 --- a/shell/src/PluginLoader.js +++ b/shell/src/PluginLoader.js @@ -4,7 +4,7 @@ import postRobot from 'post-robot' import PropTypes from 'prop-types' import React, { useCallback, useEffect, useRef, useState } from 'react' -const PluginInner = ({ +const PluginResizeInner = ({ D2App, config, propsFromParent, @@ -63,6 +63,41 @@ const PluginInner = ({ ) } +PluginResizeInner.propTypes = { + D2App: PropTypes.object, + config: PropTypes.object, + propsFromParent: PropTypes.object, + resizePluginHeight: PropTypes.func, + resizePluginWidth: PropTypes.func, +} + +const PluginInner = ({ + D2App, + config, + propsFromParent, + resizePluginHeight, + resizePluginWidth, +}) => { + if (!resizePluginHeight && !resizePluginWidth) { + return ( + + ) + } + return ( + + ) +} + PluginInner.propTypes = { D2App: PropTypes.object, config: PropTypes.object,