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

4001 - Datatable use Datagrid - Headers #4108

Merged

Conversation

yaguzmang
Copy link
Contributor

@yaguzmang yaguzmang commented Nov 12, 2024

image

image

image

image

@yaguzmang yaguzmang self-assigned this Nov 12, 2024
@yaguzmang yaguzmang marked this pull request as ready for review November 12, 2024 19:14
@yaguzmang yaguzmang requested a review from minotogna November 12, 2024 19:14
Copy link
Member

@minotogna minotogna left a 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


return {
className,
cycle,
Copy link
Member

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 })
Copy link
Member

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' : ''}`
Copy link
Member

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 = {
Copy link
Member

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

@mergify mergify bot merged commit fe9521f into 4001-datatable-use-datagrid Nov 13, 2024
5 checks passed
@mergify mergify bot deleted the 4001-datatable-use-datagrid-headers branch November 13, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants