-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ #226 - getDiaries API props에 searchKeyword 추가 * ✨ #226 - PAGE_PATH 에 검색 관련 path 추가 * 🚚 #226 - search page 폴더 구조 변경 - 불필요한 코드 제거 - 로그인 상태가 아닌 경우, 로그인 페이지로 라우팅 처리 * ✨ #226 - 검색창에 검색어 입력 시 검색 결과 페이지로 이동 - 검색 페이지/검색 결과 페이지에 따라 취소 버튼 클릭 시 라우팅 처리 - 검색 결과 페이지 새로고침 시 검색 결과 나타나도록 적용 * ✨ #226 - 검색 결과 페이지 구현 * ✨ #226 - 검색 결과 총 갯수 노출 * 🔍 #226 - seo title 수정 * 🔧 #226 - 뒤로가기 시 스크롤 복원을 위한 설정 추가 * 🍱 #226 - 아이콘 추가 * ✨ #226 - 검색 결과 정렬을 위한 UI 구현 * ✨ #226 - 최근 검색어 클릭 시 해당 검색 결과 페이지로 이동 * ✨ #226 - 검색어와 일치하는 텍스트 하이라이트 UI 적용 * 💚 #226 - 누락된 Diary 컴포넌트 props 변경으로 인한 빌드 에러 해결 * 🔥 #226 - 불필요한 템플릿 리터럴 제거 * ♻️ #226 - setSortOptions 타입 지정 및 리팩토링 * 🏷️ #226 - getServerSideProps 타입 수정 및 불필요한 타입 단언 제거 * 🩹 #226 - 잘못 적용된 searchKeyword > keyword 로 변경
- Loading branch information
1 parent
97efab8
commit a366a43
Showing
19 changed files
with
443 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
interface HighlightTextProps { | ||
text: string; | ||
keyword: string; | ||
} | ||
|
||
export const HighlightText = ({ text, keyword }: HighlightTextProps) => { | ||
const regExp = new RegExp(keyword, 'gi'); | ||
const replaceText = text.replace(regExp, `<mark>${keyword}</mark>`); | ||
|
||
return <Text dangerouslySetInnerHTML={{ __html: replaceText }} />; | ||
}; | ||
|
||
const Text = styled.span` | ||
& mark { | ||
color: ${({ theme }) => theme.colors.primary_00}; | ||
background-color: transparent; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.