Skip to content

Commit ae21749

Browse files
committed
made header sticky
1 parent c9eb34e commit ae21749

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/App.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ body {
1010
display: flex;
1111
gap: 5px;
1212
justify-content: center;
13-
background: linear-gradient(0deg, #494 10px, transparent);
13+
background: linear-gradient(0deg, #494 10px, white);
1414
padding: 10px;
15+
position: sticky;
16+
top: 0;
1517
}
1618

1719
.header button {

src/components/cities-grid/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function CitiesGrid (props) {
4545
<tbody>
4646
{cities.map((city) => {
4747
return (
48-
<tr>
48+
<tr key={city.nome}>
4949
<td>{city.nome}</td>
5050
<td>{city.municipio.microrregiao.nome}</td>
5151
</tr>

src/components/cities-grid/index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
color: white;
99
text-align: center;
1010
font-weight: bold;
11+
position: sticky;
12+
top: 50px;
1113
}
1214

1315
.cities-table td {

0 commit comments

Comments
 (0)