-
Notifications
You must be signed in to change notification settings - Fork 6
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
4001 - Datatable use Datagrid - Headers #4108
4001 - Datatable use Datagrid - Headers #4108
Conversation
yaguzmang
commented
Nov 12, 2024
•
edited
Loading
edited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 👍 just some minor comments
src/client/pages/Section/DataTable/Table/GridHead/hooks/useRenderCell.tsx
Outdated
Show resolved
Hide resolved
src/client/pages/Section/DataTable/Table/GridHead/GridHeadCell/GridHeadCell.tsx
Outdated
Show resolved
Hide resolved
|
||
return { | ||
className, | ||
cycle, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cycle should not be returned, but got from useCycle
const { colSpan: defaultColSpan, rowSpan } = Cols.getStyle({ col, cycle }) | ||
const columnName = headers[colIndex] | ||
|
||
const odpHeader = getODPHeader({ col, columnName, country, odpYears, showOdp, table }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file can be moved as sibling here, not in Table/utils
|
||
const { index } = col.props | ||
const isHeaderLeft = (index === 0 && rowIndex === 0) || row.props?.readonly | ||
const className = `table-grid__data-cell ${isHeaderLeft ? 'left' : ''}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to use classNames
import { getODPColSpan } from 'client/pages/Section/DataTable/Table/utils/getODPColSpan' | ||
import { getODPHeader } from 'client/pages/Section/DataTable/Table/utils/getODPHeader' | ||
|
||
type Props = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these props are in common with GridHeadCell.
better to create common GridHeadCellProps in ../types.ts