Skip to content
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

Table 컴포넌트 구현 #6

Closed
jindonyy opened this issue Nov 28, 2022 · 0 comments · Fixed by #7
Closed

Table 컴포넌트 구현 #6

jindonyy opened this issue Nov 28, 2022 · 0 comments · Fixed by #7
Assignees

Comments

@jindonyy
Copy link
Contributor

issue #65

예상 동작

스크린샷 2022-11-08 오후 9 55 59

  • headCell 을 누르면 정렬이 된다.
    • 오름차순, 내림차순으로 토글된다.
    • 클릭할 때마다 headCell 의 스타일이 변한다.

제공하고자 하는 인터페이스

type SortState = {
  name: string;
  direction: 'ascending' | 'descending';
  sortIndices: number[];
} | null;

type SortConfig = {
  sortValues?: { [key in string]: (string | number)[] };
  sortState: SortState;
  setSortState: Dispatch<SetStateAction<SortState>>;
};

type HeadCellProps = {
  ...
  sortConfig?: SortConfig;
  children: ReactElement | ReactElement[];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant