Skip to content

Commit d4b549e

Browse files
committed
Run with yarn format, and made margin a prop component
1 parent 675c417 commit d4b549e

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

workspaces/simon-game/src/app/components/App.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ export function App() {
66
return (
77
<div>
88
<Box color="red" />
9-
<Box color={
10-
// cobalt blue
11-
"#0050B5"
12-
} />
9+
<Box
10+
color={
11+
// cobalt blue
12+
"#0050B5"
13+
}
14+
/>
1315
<Box color="green" />
1416
<Box color="yellow" />
1517
</div>

workspaces/simon-game/src/app/components/Box.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import React from "react";
22

3-
type Props = { color?: string; height?: number; width?: number };
3+
type Props = {
4+
color?: string;
5+
height?: number;
6+
width?: number;
7+
margin?: number;
8+
};
49

510
export function Box(props: Props) {
611
return (
@@ -10,7 +15,7 @@ export function Box(props: Props) {
1015
height: props.height ?? 100,
1116
width: props.width ?? 100,
1217
borderRadius: 20, // rounded corners
13-
margin: 10, // spaces
18+
margin: props.margin, // spaces between boxes
1419
}}
1520
/>
1621
);

0 commit comments

Comments
 (0)