-
Notifications
You must be signed in to change notification settings - Fork 24
7강 정연준 과제제출 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
7강 정연준 과제제출 #1
Conversation
meteorqz6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
과제하느라 고생하셨습니다! 코드 리뷰 반영해서 커밋 추가해주세요😊
| if (!weatherData) return []; | ||
| // 밑에 코드 채워주세요 | ||
| return []; | ||
| const time = weatherData.hourly.time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구조분해할당을 활용하면 가독성이 좋아질 것 같아요
const { time, temperature_2m, weather_code } = weatherData;
| if (!weatherData) return []; | ||
| // 밑에 코드 채워주세요 | ||
| return []; | ||
| const time = weatherData.daily.time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구조분해할당 활용해보는 게 어떨까요?
| }; | ||
| if (isLoading) { | ||
| return <div>채워주세요</div>; | ||
| return <div>현재날씨 로딩중...</div>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스켈레톤 컴포넌트 공부해서 적용해보면 좋을 것 같습니다
| {dailyData.map((data, idx) => ( | ||
| <DailyItem key={idx}> | ||
| <div> | ||
| {`${new Date(data.time).getMonth() + 1}월 ${new Date( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
날짜 및 요일과 같은 데이터 포맷 가공 로직은 관심사의 분리를 위해 weather.js의 formatDailyData에서 하는 것이 유지보수에 더 유리할 것 같아요
| {hourlyData.map((data, idx) => ( | ||
| <HourlyItem key={idx}> | ||
| <div> | ||
| {new Date(data.time).getHours().toString().padStart(2, "0")}시 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
날짜 및 요일과 같은 데이터 포맷 가공 로직은 관심사의 분리를 위해 weather.js의 formatHourlyData에서 하는 것이 유지보수에 더 유리할 것 같아요
7강 과제제출입니다.