Skip to content

Commit 874ca83

Browse files
authored
Merge pull request #153 from chvmvd/fix-bug-in-browser-window
Fix bug in BrowserWindow #152
2 parents 73259a4 + db4cbd7 commit 874ca83

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/components/BrowserWindow/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ import styles from "./styles.module.css";
1212

1313
interface Props {
1414
children: ReactNode;
15-
height: string;
15+
minHeight?: string;
16+
height?: string;
1617
url?: string;
1718
}
1819

1920
export default function BrowserWindow({
2021
children,
22+
minHeight,
2123
height,
2224
url = "http://localhost:3000",
2325
}: Props): JSX.Element {
2426
return (
25-
<div className={styles.browserWindow} style={{ height }}>
27+
<div className={styles.browserWindow} style={{ minHeight, height }}>
2628
<div className={styles.browserWindowHeader}>
2729
<div className={styles.buttons}>
2830
<span className={styles.dot} style={{ background: "#f25f58" }} />

src/components/IframeOutput/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export default function IframeOutput({
1010
}) {
1111
return (
1212
<>
13-
<BrowserWindow height={height === undefined ? "200px" : height}>
13+
<BrowserWindow
14+
height={height !== undefined && height}
15+
minHeight={height === undefined && "200px"}
16+
>
1417
<iframe
1518
width="100%"
1619
height="100%"

0 commit comments

Comments
 (0)