Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

4-6 [FE][fix] 인기검색어 클릭시 검색결과 페이지로 이동하는 방식 수정 #70

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

Palwol
Copy link
Collaborator

@Palwol Palwol commented Nov 28, 2022

개요

인기검색어 클릭시 검색결과 페이지로 이동하는 방식을 수정했습니다.
기존 : 각 키워드에 onClick 이벤트를 달고 click 시 navigate를 이용하여 페이지 이동
수정 : 각 키워드에 Link를 적용하여 페이지 이동

페이지 이동에 react-router-dom을 사용하고 있는데, navigate를 사용하는 것보다 Link 기능을 사용하는 것이 더 직관적으로 페이지 이동을 파악할 수 있고, 코드 양을 줄일 수 있다고 판단하여 수정하였습니다.

작업사항

  • 인기검색어 클릭시 검색결과 페이지로 이동 로직 navigate -> Link로 변경
  • GlobalStyle에서 a 요소 기본 스타일 제거
  • .eslint.json 파일 주석 제거

Comment on lines +54 to +59
<Link key={data.keyword} to={createSearchQuery(data.keyword)}>
<KeywordContainer>
<KeywordIndex>{index + 1}</KeywordIndex>
<Keyword>{data.keyword}</Keyword>
</KeywordContainer>
</Link>
Copy link
Member

Choose a reason for hiding this comment

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

확실히 Link 컴포넌트로 감싸는 방식이 더 눈에 잘 들어오네요. 좋은 방법입니다.

Copy link
Member

@leesungbin leesungbin left a comment

Choose a reason for hiding this comment

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

확인했습니다~

@Palwol Palwol merged commit 1ce7790 into dev Nov 28, 2022
@yeynii yeynii deleted the refactor/keyword-ranking branch November 29, 2022 04:04
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants