Skip to content

Conversation

@jebiyeon02
Copy link

7강 과제제출입니다.

Copy link
Member

@meteorqz6 meteorqz6 left a 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;
Copy link
Member

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;
Copy link
Member

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>;
Copy link
Member

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(
Copy link
Member

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")}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

날짜 및 요일과 같은 데이터 포맷 가공 로직은 관심사의 분리를 위해 weather.js의 formatHourlyData에서 하는 것이 유지보수에 더 유리할 것 같아요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants