Repository navigation
[Feature/#401] 타임라인 바 필터/정렬 연동 #409
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7130514
feat: 타임라인 sort/filter 타입 정의
jjjsun 1c3336b
feat: list키에 sort/status 반영
jjjsun 8c66269
feat: 타임라인조회 API훅에 params추가
jjjsun f373264
feat: useTimelineList훅 params받아서 쿼리
jjjsun 4dca963
feat: 필터/정렬 라벨링
jjjsun ccbf747
feat: 타임라인 정렬/필터 컴포넌트 구현
jjjsun 43ae445
feat: mock데이터 수정
jjjsun f4d44a4
feat: 타임라인페이지에 구현된 컴포넌트 삽입
jjjsun 08eba53
fix: 타임라인 정렬 라벨을 실제 정렬순서에 맞게 수정
jjjsun b173bb0
fix: 상대 경로 별칭 import로 수정
jjjsun 3d16801
fix: 타임라인 바 정렬/필터 값 페이지 unmount후에도 남아이도록 Zustand로 이동
jjjsun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,73 @@ | ||
| import { twMerge } from "tailwind-merge"; | ||
|
|
||
| import type { TTimelineSort } from "@/types/timeline/api"; | ||
| import { | ||
| TIMELINE_SORT_OPTIONS, | ||
| TIMELINE_STATUS_FILTER_OPTIONS, | ||
| type TTimelineStatusFilter, | ||
| } from "@/constants/timeline/filterSort"; | ||
|
|
||
| import { | ||
| DropdownMenu, | ||
| type TMenuItem, | ||
| } from "../common/dropdownmenu/DropdownMenu"; | ||
|
|
||
| import FilterIcon from "@/assets/icon/timeline/filter.svg?react"; | ||
| import SortIcon from "@/assets/icon/timeline/sort.svg?react"; | ||
|
|
||
| const TOOLBAR_ACTIONS_CLASS = | ||
| "flex cursor-pointer items-center gap-1.5 rounded-lg px-2 py-1.5 font-caption text-text-muted transition-all hover:bg-surface-200 hover:text-text-body"; | ||
|
|
||
| interface ITimelineFilterSortMenusProps { | ||
| statusFilter: TTimelineStatusFilter; | ||
| sort: TTimelineSort; | ||
| onStatusFilterChange: (value: TTimelineStatusFilter) => void; | ||
| onSortChange: (value: TTimelineSort) => void; | ||
| className?: string; | ||
| } | ||
|
|
||
| export default function TimelineFilterSortMenus({ | ||
| statusFilter, | ||
| sort, | ||
| onStatusFilterChange, | ||
| onSortChange, | ||
| className, | ||
| }: ITimelineFilterSortMenusProps) { | ||
| const sortItems: TMenuItem[] = TIMELINE_SORT_OPTIONS.map((opt) => ({ | ||
| label: opt.label, | ||
| active: sort === opt.value, | ||
| onClick: () => onSortChange(opt.value), | ||
| })); | ||
|
|
||
| const filterItems: TMenuItem[] = TIMELINE_STATUS_FILTER_OPTIONS.map( | ||
| (opt) => ({ | ||
| label: opt.label, | ||
| active: statusFilter === opt.value, | ||
| onClick: () => onStatusFilterChange(opt.value), | ||
| }), | ||
| ); | ||
| return ( | ||
| <div className={twMerge("flex items-center gap-3", className)}> | ||
| <DropdownMenu | ||
| aria-label="타임라인 정렬" | ||
| items={sortItems} | ||
| trigger={ | ||
| <span className={TOOLBAR_ACTIONS_CLASS}> | ||
| <SortIcon className="h-4 w-4" /> | ||
| Sort | ||
| </span> | ||
| } | ||
| /> | ||
| <DropdownMenu | ||
| aria-label="성과 상태 필터" | ||
| items={filterItems} | ||
| trigger={ | ||
| <span className={TOOLBAR_ACTIONS_CLASS}> | ||
| <FilterIcon className="h-4 w-4" /> | ||
| Filter | ||
| </span> | ||
| } | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or 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,36 @@ | ||
| import type { | ||
| TTimelinePerformanceStatus, | ||
| TTimelineSort, | ||
| } from "@/types/timeline/api"; | ||
|
|
||
| import { TIMELINE_PERFORMANCE_STATUS_STYLE } from "./statusStyle"; | ||
|
|
||
| export type TTimelineStatusFilter = TTimelinePerformanceStatus | "ALL"; | ||
|
|
||
| export const TIMELINE_STATUS_FILTER_OPTIONS: { | ||
| value: TTimelineStatusFilter; | ||
| label: string; | ||
| }[] = [ | ||
| { value: "ALL", label: "전체" }, | ||
| { | ||
| value: "ON_TRACK", | ||
| label: TIMELINE_PERFORMANCE_STATUS_STYLE.ON_TRACK.label, | ||
| }, | ||
| { | ||
| value: "ABOVE_AVG", | ||
| label: TIMELINE_PERFORMANCE_STATUS_STYLE.ABOVE_AVG.label, | ||
| }, | ||
| { | ||
| value: "UNDERPERFORM", | ||
| label: TIMELINE_PERFORMANCE_STATUS_STYLE.UNDERPERFORM.label, | ||
| }, | ||
| ]; | ||
|
|
||
| export const TIMELINE_SORT_OPTIONS: { | ||
| value: TTimelineSort; | ||
| label: string; | ||
| }[] = [ | ||
| { value: "DISPLAY_ORDER", label: "기본 순서" }, | ||
| { value: "LATEST", label: "종료일 먼 순" }, | ||
| { value: "OLDEST", label: "종료일 가까운 순" }, | ||
| ]; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.