refactor: add ColumnDefinition type (#1357)
* refactor: add ColumnDefinition type Closes #1193 * refactor: code review - rename things * fix: fix wrong import and lint
This commit is contained in:
@ -114,16 +114,16 @@ export function EntityTableHeader() {
|
||||
|
||||
const nextWidth = Math.round(
|
||||
Math.max(
|
||||
columnsById[resizedFieldId].columnSize +
|
||||
columnsById[resizedFieldId].size +
|
||||
snapshot.getLoadable(resizeFieldOffsetState).valueOrThrow(),
|
||||
COLUMN_MIN_WIDTH,
|
||||
),
|
||||
);
|
||||
|
||||
if (nextWidth !== columnsById[resizedFieldId].columnSize) {
|
||||
if (nextWidth !== columnsById[resizedFieldId].size) {
|
||||
const nextColumns = columns.map((column) =>
|
||||
column.id === resizedFieldId
|
||||
? { ...column, columnSize: nextWidth }
|
||||
? { ...column, size: nextWidth }
|
||||
: column,
|
||||
);
|
||||
|
||||
@ -179,15 +179,12 @@ export function EntityTableHeader() {
|
||||
key={column.id}
|
||||
isResizing={resizedFieldId === column.id}
|
||||
columnWidth={Math.max(
|
||||
columnsById[column.id].columnSize +
|
||||
columnsById[column.id].size +
|
||||
(resizedFieldId === column.id ? offset : 0),
|
||||
COLUMN_MIN_WIDTH,
|
||||
)}
|
||||
>
|
||||
<ColumnHead
|
||||
viewName={column.columnLabel}
|
||||
viewIcon={column.columnIcon}
|
||||
/>
|
||||
<ColumnHead viewName={column.label} viewIcon={column.icon} />
|
||||
<StyledResizeHandler
|
||||
className="cursor-col-resize"
|
||||
role="separator"
|
||||
|
||||
Reference in New Issue
Block a user