Skip to content

Commit

Permalink
DataViews: Simplify conditional styling for table column widths
Browse files Browse the repository at this point in the history
  • Loading branch information
SainathPoojary committed Feb 14, 2025
1 parent ca275f8 commit d8aa755
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions packages/dataviews/src/dataviews-layouts/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ function TableRow< Item >( {
{ hasPrimaryColumn && (
<td
style={ {
width: titleField?.id
? view.layout?.styles?.[ titleField.id ]?.width
: undefined,
maxWidth: titleField?.id
? view.layout?.styles?.[ titleField.id ]?.maxWidth
: undefined,
minWidth: titleField?.id
? view.layout?.styles?.[ titleField.id ]?.minWidth
: undefined,
width:
titleField?.id &&
view.layout?.styles?.[ titleField.id ]?.width,
maxWidth:
titleField?.id &&
view.layout?.styles?.[ titleField.id ]?.maxWidth,
minWidth:
titleField?.id &&
view.layout?.styles?.[ titleField.id ]?.minWidth,
} }
>
<ColumnPrimary
Expand Down Expand Up @@ -331,18 +331,18 @@ function ViewTable< Item >( {
<th
scope="col"
style={ {
width: titleField?.id
? view.layout?.styles?.[ titleField.id ]
?.width
: undefined,
maxWidth: titleField?.id
? view.layout?.styles?.[ titleField.id ]
?.maxWidth
: undefined,
minWidth: titleField?.id
? view.layout?.styles?.[ titleField.id ]
?.minWidth
: undefined,
width:
titleField?.id &&
view.layout?.styles?.[ titleField.id ]
?.width,
maxWidth:
titleField?.id &&
view.layout?.styles?.[ titleField.id ]
?.maxWidth,
minWidth:
titleField?.id &&
view.layout?.styles?.[ titleField.id ]
?.minWidth,
} }
>
<span className="dataviews-view-table-header">
Expand Down

0 comments on commit d8aa755

Please sign in to comment.