Skip to content

Commit

Permalink
fix: move height/width out of styles
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp committed Sep 9, 2024
1 parent 5868050 commit 737b238
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions services/plugin/src/Plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ const getPluginEntryPoint = ({
)?.pluginLaunchUrl
}

const getIframeDimension = (dimension: string): string => {
if (!isNaN(Number(dimension))) {
return `${Number(dimension)}px`
}
return dimension
}

export const Plugin = ({
pluginSource,
pluginShortName,
Expand Down Expand Up @@ -150,15 +143,9 @@ export const Plugin = ({
<iframe
ref={iframeRef}
src={pluginSource}
width={width ?? resizedWidth + 'px'}
height={height ?? resizedHeight + 'px'}
style={{
width: `${
width ? getIframeDimension(width) : resizedWidth + 'px'
}`,
height: `${
height
? getIframeDimension(height)
: resizedHeight + 'px'
}`,
border: 'none',
}}
></iframe>
Expand Down

0 comments on commit 737b238

Please sign in to comment.