Skip to content

Commit 8d9febc

Browse files
committed
finish
1 parent f4c9cd9 commit 8d9febc

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/App.css

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
align-items: center;
55
}
66

7-
.grid {
8-
9-
}
10-
117
.grid-row {
128
display: flex;
139
flex-direction: row;
@@ -23,6 +19,10 @@
2319
height: 15px;
2420
}
2521

22+
.grid-cell:last-child {
23+
border-right: 1px solid #000000;
24+
}
25+
2626
.grid-cell-border {
2727
background-color: #000000;
2828
}
@@ -32,13 +32,9 @@
3232
}
3333

3434
.grid-cell-snack {
35-
background-color: #008000;
35+
background-color: blue;
3636
}
3737

3838
.grid-cell-hit {
3939
background-color: red;
4040
}
41-
42-
.grid-cell:last-child {
43-
border-right: 1px solid #000000;
44-
}

src/App.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,26 +192,30 @@ class App extends Component {
192192
}
193193

194194
const Grid = ({ isGameOver, snake, snack }) =>
195-
<div className="grid">
196-
{GRID.map(y => <Row
197-
y={y}
198-
key={y}
199-
snake={snake}
200-
snack={snack}
201-
isGameOver={isGameOver}
202-
/>)}
195+
<div>
196+
{GRID.map(y =>
197+
<Row
198+
y={y}
199+
key={y}
200+
snake={snake}
201+
snack={snack}
202+
isGameOver={isGameOver}
203+
/>
204+
)}
203205
</div>
204206

205207
const Row = ({ isGameOver, snake, snack, y }) =>
206208
<div className="grid-row">
207-
{GRID.map(x => <Cell
208-
x={x}
209-
y={y}
210-
key={x}
211-
snake={snake}
212-
snack={snack}
213-
isGameOver={isGameOver}
214-
/>)}
209+
{GRID.map(x =>
210+
<Cell
211+
x={x}
212+
y={y}
213+
key={x}
214+
snake={snake}
215+
snack={snack}
216+
isGameOver={isGameOver}
217+
/>
218+
)}
215219
</div>
216220

217221
const Cell = ({ isGameOver, snake, snack, x, y }) =>

0 commit comments

Comments
 (0)