-
Notifications
You must be signed in to change notification settings - Fork 41
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
홈화면에서 쓰이는 아티클 리스트 컴포넌트를 추가합니다. #97
홈화면에서 쓰이는 아티클 리스트 컴포넌트를 추가합니다. #97
Conversation
Object.entries(params).forEach(([key, value]) => { | ||
if (value) { | ||
newSearchParams.append(key, `${value}`); | ||
} | ||
}); |
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.
export interface ArticlesQueryParamsType {
tag?: string;
author?: string;
favorited?: string;
offset?: number;
limit?: number;
}
여기에 사용되는 prams 가 길기 때문에 이를 string 으로 직접 넣어주는 것이 아닌 URLSearchParams를 통해 만들어줍니다.
<ul className="tag-list"> | ||
{tagList.map(tag => { | ||
return ( | ||
<li className="tag-default tag-pill tag-outline" key={tag}> | ||
{tag} | ||
</li> | ||
); | ||
})} | ||
</ul> |
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.
차후 하단 태그 컴포넌트를 분리하도록 하겠습니다.
<div className="feed-toggle"> | ||
<ul className="nav nav-pills outline-active"> | ||
<li className="nav-item"> | ||
<a className="nav-link" href="/"> | ||
Your Feed | ||
</a> | ||
</li> | ||
<li className="nav-item"> | ||
<a className="nav-link active" href="/"> | ||
Global Feed | ||
</a> | ||
</li> | ||
</ul> | ||
</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.
toggle을 추가하였습니다. login 기능연동이 필요할것 같아 로그인 상태를 어떻게 할지 고민해본 다음에 연동해볼게요
<ul className="pagination"> | ||
<li className="page-item active"> | ||
<a className="page-link" href="/"> | ||
1 | ||
</a> | ||
</li> | ||
<li className="page-item"> | ||
<a className="page-link" href="/"> | ||
2 | ||
</a> | ||
</li> | ||
</ul> |
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.
페이지네이션은 tanstack-query-pagenation 을 사용할 수 있지만 Hydration 때 json 직렬화 과정에서 너무 느렸습니다.
상태나 searchParams을 통해 페이지를 관리하고 UseQuery에 바로 넣어줄 예정입니다.
이거 정말 장난 아니네요........ ㅋㅋ |
📌 이슈 링크
📖 작업 배경
🛠️ 구현 내용
💡 참고사항
exmaple
라는 폴더가 있을 경우https://someDomain/example
와 같이 Router를 해주는 폴더인지 눈으로만 보고는 구분이 어렵습니다.🖼️ 스크린샷