@@ -5,13 +5,10 @@ import cs from 'clsx';
5
5
/** @jsx jsx */
6
6
import { css , jsx } from '@emotion/react' ;
7
7
8
- import { RowContainer } from '@table-library/react-table-library/common/components/Row' ;
9
8
import { isRowClick } from '@table-library/react-table-library/common/util/isRowClick' ;
9
+ import { RowContainer } from '@table-library/react-table-library/common/components/Row' ;
10
10
import { ThemeContext } from '@table-library/react-table-library/common/context/Theme' ;
11
- import { SelectContext } from '@table-library/react-table-library/common/context/Select' ;
12
- import { TreeContext } from '@table-library/react-table-library/common/context/Tree' ;
13
- import { SortContext } from '@table-library/react-table-library/common/context/Sort' ;
14
- import { PaginationContext } from '@table-library/react-table-library/common/context/Pagination' ;
11
+ import { useFeatures } from '@table-library/react-table-library/common/context/Feature' ;
15
12
16
13
import { useConsumeRowLayout } from '@table-library/react-table-library/resize/useConsumeRowLayout' ;
17
14
@@ -77,19 +74,7 @@ const evaluateProps = (rowPropsByFeature: FeatureProps[], onSingleClick: OnClick
77
74
export const Row : React . FC < RowProps > = ( props : RowProps ) => {
78
75
const { item, className, disabled, onClick, onDoubleClick, children, ...rest } = props ;
79
76
80
- const select = React . useContext ( SelectContext ) ;
81
- const tree = React . useContext ( TreeContext ) ;
82
- const sort = React . useContext ( SortContext ) ;
83
- const pagination = React . useContext ( PaginationContext ) ;
84
-
85
- const features = {
86
- select,
87
- tree,
88
- sort,
89
- pagination,
90
- // others
91
- } ;
92
-
77
+ const features = useFeatures ( ) ;
93
78
const rowPropsByFeature = getRowProps ( features , props ) ;
94
79
95
80
const theme = React . useContext ( ThemeContext ) ;
0 commit comments