Skip to content

Commit e60a2a0

Browse files
author
Ives van Hoorne
committed
Tweak embed height
1 parent 9a6be6a commit e60a2a0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/embed/components/Content.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { getModulePath } from 'app/store/entities/sandboxes/modules/selectors';
99
import type { Sandbox, Module, ModuleError } from 'common/types';
1010
import fetchBundle from 'app/store/entities/sandboxes/bundler';
1111

12+
const MIN_HEIGHT = 250;
13+
1214
const Container = styled.div`
1315
display: flex;
1416
position: relative;
@@ -73,11 +75,12 @@ export default class Content extends React.PureComponent {
7375

7476
handleResize = (height: number) => {
7577
if (this.props.autoResize) {
78+
const extraOffset = this.props.hideNavigation ? 75 : 150;
7679
window.parent.postMessage(
7780
JSON.stringify({
7881
src: window.location.toString(),
7982
context: 'iframe.resize',
80-
height: Math.max(height + 150, 500), // pixels
83+
height: Math.max(height + extraOffset, MIN_HEIGHT), // pixels
8184
}),
8285
'*',
8386
);
@@ -86,7 +89,7 @@ export default class Content extends React.PureComponent {
8689
JSON.stringify({
8790
src: window.location.toString(),
8891
context: 'iframe.resize',
89-
height: 500, // pixels
92+
height: MIN_HEIGHT, // pixels
9093
}),
9194
'*',
9295
);

0 commit comments

Comments
 (0)