Skip to content
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

[신윤하] Sprint10 #300

Conversation

ayoooyh
Copy link
Collaborator

@ayoooyh ayoooyh commented Aug 16, 2024

요구사항

기본

  • [x]
  • []
  • []

심화

  • [x]
  • []

주요 변경사항

스크린샷

image

멘토에게

  • 아직 미완성입니다. 주말 내에 최대한 완성하도록 하겠습니다!

@ayoooyh ayoooyh requested a review from arthurkimdev August 16, 2024 14:47
@ayoooyh ayoooyh self-assigned this Aug 16, 2024
@ayoooyh ayoooyh added the 미완성🫠 죄송합니다.. label Aug 16, 2024
@arthurkimdev arthurkimdev changed the base branch from main to Next-신윤하 August 21, 2024 00:24
Comment on lines +1 to +3
import ArticleSection from "@/components/Boards/ArticleSection";
import BestArticleSection from "@/components/Boards/BestArticleSection";
import Header from "@/components/Header";
Copy link
Collaborator

Choose a reason for hiding this comment

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

현재 디렉토리 가져올 때 @/components 되어있는데, tsconfig 값에 paths 수정하는 방향으로 아래처럼 바꿔보면 가독성이 더 좋을 것 같습니다 😄

import ArticleSection from "@components/Boards/ArticleSection";
import BestArticleSection from "@components/Boards/BestArticleSection";
import Header from "@components/Header";

Copy link
Collaborator

@arthurkimdev arthurkimdev left a comment

Choose a reason for hiding this comment

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

이번주 과제 제출하시느라 수고하셨습니다! 🙏

Comment on lines +10 to +12
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
setValue(e.target.value);
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

아래처럼 이벤트 핸들러 함수들은 useCallback 사용해서 메모이제이션하는 방법도 있어요. 이런 경우, 불필요한 리랜더링을 방지해줄 수 있습니다.

Suggested change
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
setValue(e.target.value);
};
const handleChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
setValue(e.target.value);
}, []);

Comment on lines +5 to +24
// const [articles, setArticles] = useState();

// // const viewportWidth = useViewport();

// useEffect(() => {
// // if (viewportWidth === 0) return;

// const fetchBestArticles = async (size: number) => {
// try {
// const response = await fetch(
// `https://panda-market-api.vercel.app/articles?orderBy=like&pageSize=${size}`
// );
// const data: ArticleListResponse = await response.json();
// setArticles(data.list);
// } catch (error) {
// console.error("Failed to fetch best articles:", error);
// }
// fetchBestArticles(newPageSize);
// };
// }, []);
Copy link
Collaborator

Choose a reason for hiding this comment

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

불필요한 주석은 제거해주시는게 좋아요~

@arthurkimdev arthurkimdev merged commit e40bfd8 into codeit-bootcamp-frontend:Next-신윤하 Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
미완성🫠 죄송합니다..
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants