-
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.
* ✨ #245 - 정렬 관련 상수 선언 및 타입 정의 * ✨ #254 - useDiary에 sortBy 매개변수 추가 * ✨ #254 - 검색 결과 정렬 기능 구현 * ♻️ #254 - 정렬 기준 변경 시 정렬 목록을 순회하며 연산하는 코드 개선 * ♻️ #254 - 정렬 목록 초기값을 복사하여 useState에 적용
- Loading branch information
1 parent
b6997c7
commit 8ccf30a
Showing
8 changed files
with
86 additions
and
41 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
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 @@ | ||
export * from './sortBy'; |
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,23 @@ | ||
export const SORT_BY_ID = { | ||
latest: 'latest', | ||
popularity: 'popularity', | ||
comments: 'comments', | ||
} as const; | ||
|
||
export const INITIAL_SORT_BY_LIST = [ | ||
{ | ||
id: SORT_BY_ID.latest, | ||
title: '최신순', | ||
selected: true, | ||
}, | ||
{ | ||
id: SORT_BY_ID.popularity, | ||
title: '인기순', | ||
selected: false, | ||
}, | ||
{ | ||
id: SORT_BY_ID.comments, | ||
title: '댓글순', | ||
selected: false, | ||
}, | ||
] as const; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
import type { SORT_BY_ID } from 'constants/search'; | ||
|
||
export interface SearchForm { | ||
searchKeyword: string; | ||
} | ||
|
||
export type SortByType = keyof typeof SORT_BY_ID; | ||
|
||
export interface SortByOption { | ||
id: SortByType; | ||
title: string; | ||
selected: boolean; | ||
} |