-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(popular-locations): implement popular cities (#22)
* feat(popular-locations): implement popular cities * change property name
- Loading branch information
1 parent
a85d9a4
commit 9ffc559
Showing
5 changed files
with
69 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { trpc } from '@utils/trpc'; | ||
|
||
const PopularLocations = () => { | ||
const [data] = trpc.getPopularLocations.useSuspenseQuery(); | ||
|
||
return ( | ||
<div className='popular-cities'> | ||
<h1>Popular Cities</h1> | ||
|
||
<div className='cities'> | ||
{ | ||
data.map((city) => ( | ||
<div key={ city.name }> | ||
<h2>{ city.name }</h2> | ||
<span>{ city.temp_c }°C</span> | ||
</div> | ||
)) | ||
} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PopularLocations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters