Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bsholmes committed Jan 12, 2024
1 parent bdda5b3 commit bce35af
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/components/Table/components/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function RowImpl<R extends Kinded, S>(props: RowProps<R>): ReactElement {
// used to render the whole row when dragging with the handle
const ref = useRef<HTMLTableRowElement>(null);

const RowContent = () => (
const RowContent = () => (
<RowTag css={rowCss} {...others} data-gridrow {...getCount(row.id)}>
{isKeptGroupRow ? (
<KeptGroupRow as={as} style={style} columnSizes={columnSizes} row={row} colSpan={columns.length} />
Expand All @@ -154,8 +154,7 @@ function RowImpl<R extends Kinded, S>(props: RowProps<R>): ReactElement {
const numExpandedColumns = isExpanded
? tableState.numberOfExpandedChildren(maybeExpandedColumn.id)
? // Subtract 1 if the column is hidden on expand, since we're not rendering it.
tableState.numberOfExpandedChildren(maybeExpandedColumn.id) -
(maybeExpandedColumn.hideOnExpand ? 1 : 0)
tableState.numberOfExpandedChildren(maybeExpandedColumn.id) - (maybeExpandedColumn.hideOnExpand ? 1 : 0)
: 0
: 0;

Expand Down Expand Up @@ -247,8 +246,7 @@ function RowImpl<R extends Kinded, S>(props: RowProps<R>): ReactElement {
maybeContent,
);

const maybeSticky =
((isGridCellContent(maybeContent) && maybeContent.sticky) || column.sticky) ?? undefined;
const maybeSticky = ((isGridCellContent(maybeContent) && maybeContent.sticky) || column.sticky) ?? undefined;
const maybeStickyColumnStyles =
maybeSticky && columnSizes
? {
Expand All @@ -267,8 +265,7 @@ function RowImpl<R extends Kinded, S>(props: RowProps<R>): ReactElement {
: {};

// This relies on our column sizes being defined in pixel values, which is currently true as we calculate to pixel values in the `useSetupColumnSizes` hook
minStickyLeftOffset +=
maybeSticky === "left" ? parseInt(columnSizes[columnIndex].replace("px", ""), 10) : 0;
minStickyLeftOffset += maybeSticky === "left" ? parseInt(columnSizes[columnIndex].replace("px", ""), 10) : 0;

const cellId = `${row.kind}_${row.id}_${column.id}`;
const applyCellHighlight = cellHighlight && !!column.id && !isHeader && !isTotals;
Expand Down Expand Up @@ -362,7 +359,9 @@ function RowImpl<R extends Kinded, S>(props: RowProps<R>): ReactElement {
>
<RowContent />
</div>
) : <RowContent />;
) : (
<RowContent />
);
}

/**
Expand Down

0 comments on commit bce35af

Please sign in to comment.