Skip to content

Commit

Permalink
Added city in places page
Browse files Browse the repository at this point in the history
  • Loading branch information
silversonicaxel committed May 4, 2024
1 parent f2aa94b commit 7ad8b48
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/places/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ export default async function PlacesPage() {
getPlacesData()
])

return places.map((place, idx) => (
<div key={`place-${idx}`} className={styles.uaplaces}>
return places.map((place) => (
<div key={`place-${place.id}`} className={styles.uaplaces}>
<Link href={`places/${place.id}`}>
{place.name} - {countryCodes[place.iso]}
<span>{place.name}</span>
&nbsp;
<span>~</span>
&nbsp;
<span>
{place.city ? `${place.city} - ` : ``}
{countryCodes[place.iso]}
</span>
</Link>
</div>
))
Expand Down
1 change: 1 addition & 0 deletions app/places/places.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.uaplaces a {
display: inline-block;
margin-bottom: 5px;
transition: transform 0.5s ease-in-out;
}

Expand Down
1 change: 1 addition & 0 deletions src/types/place.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export type Place = {
address: string
site?: string
iso: string
city?: string
}

0 comments on commit 7ad8b48

Please sign in to comment.