Open
Conversation
meteorqz6
reviewed
May 26, 2025
Member
meteorqz6
left a comment
There was a problem hiding this comment.
과제하느라 고생하셨습니다~~ 코드 리뷰 반영해서 커밋 다시 해주세요🙂
| // 밑에 코드 채워주세요 | ||
| return []; | ||
|
|
||
| const times = weatherData.hourly.time; |
Member
There was a problem hiding this comment.
구조분해할당을 활용하면 가독성이 좋아질 것 같아요
const { time, temperature_2m, weather_code } = weatherData;
| const codes = weatherData.hourly.weather_code; | ||
| const result = []; | ||
| for (let i = 0; i < 12; i++) { | ||
| const str = parseInt(times[i].slice(11, 13), 10) + "시"; // parseInt: 문자열을 정수로 바꿔주는 함수 |
Member
There was a problem hiding this comment.
개인적으로는 new Date(time[i]).getHours() + '시' 가 더 깔끔할 것 같아요
| // 밑에 코드 채워주세요 | ||
| return []; | ||
|
|
||
| const dates = weatherData.daily.time; |
| const CurrentWeather = ({ weatherData, isLoading }) => { | ||
| if (isLoading) { | ||
| return <div>채워주세요</div>; | ||
| return <div>날씨 정보를 불러오는 중...</div>; |
Member
There was a problem hiding this comment.
temperature, code가 인덱스 0인 값으로 고정되어 있어서 현재 기온과 날씨 상태 표시되는 기능이 작동하지 않아요! 현재 기온과 날씨 상태 표시되도록 코드 수정해주세요
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
현재 날씨, 시간별 날씨, 일별 날씨를 표시하는 컴포넌트를 구현함.
각 데이터는 map 함수로 반복 렌더링됨.
getWeatherDescription는 날씨 코드를 한글 텍스트로 변환함.
formatHourlyData, formatDailyData 함수는 각각 시간별, 일별 데이터 형식으로 배열을 재구성함.