Skip to content

Commit

Permalink
fix: fixed dimensions plugins [LIBS-634] (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp authored Jul 1, 2024
1 parent 949ea83 commit 1f717f3
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion shell/src/PluginLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 (
<D2App
config={config}
resizePluginWidth={resizePluginWidth}
{...propsFromParent}
/>
)
}
return (
<PluginResizeInner
D2App={D2App}
config={config}
propsFromParent={propsFromParent}
resizePluginHeight={resizePluginHeight}
resizePluginWidth={resizePluginWidth}
/>
)
}

PluginInner.propTypes = {
D2App: PropTypes.object,
config: PropTypes.object,
Expand Down

0 comments on commit 1f717f3

Please sign in to comment.