Skip to content

Commit c48fef8

Browse files
committed
Update examples
1 parent 7e42776 commit c48fef8

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

examples/simple/src/ResizableBox.js

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,41 @@ export default function ResizableBox({
1313
}) {
1414
return (
1515
<div style={{ marginLeft: 20 }}>
16-
{resizable ? (
17-
<ReactResizableBox width={width} height={height}>
16+
<div
17+
style={{
18+
display: "inline-block",
19+
width: "auto",
20+
background: "white",
21+
padding: ".5rem",
22+
borderRadius: "0.5rem",
23+
boxShadow: "0 30px 40px rgba(0,0,0,.1)",
24+
...style,
25+
}}
26+
>
27+
{resizable ? (
28+
<ReactResizableBox width={width} height={height}>
29+
<div
30+
style={{
31+
width: "100%",
32+
height: "100%",
33+
}}
34+
className={className}
35+
>
36+
{children}
37+
</div>
38+
</ReactResizableBox>
39+
) : (
1840
<div
1941
style={{
20-
boxShadow: "0 20px 40px rgba(0,0,0,.1)",
21-
...style,
22-
width: "100%",
23-
height: "100%",
42+
width: `${width}px`,
43+
height: `${height}px`,
2444
}}
2545
className={className}
2646
>
2747
{children}
2848
</div>
29-
</ReactResizableBox>
30-
) : (
31-
<div
32-
style={{
33-
width: `${width}px`,
34-
height: `${height}px`,
35-
boxShadow: "0 20px 40px rgba(0,0,0,.1)",
36-
...style,
37-
}}
38-
className={className}
39-
>
40-
{children}
41-
</div>
42-
)}
49+
)}
50+
</div>
4351
</div>
4452
);
4553
}

examples/simple/src/styles.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ body {
44

55
.react-resizable {
66
max-width: 100%;
7-
background: white;
87
}
98

109
.react-resizable-handle {

0 commit comments

Comments
 (0)