Skip to content

Commit 642d589

Browse files
committed
chore: update table header icon
1 parent e017cf8 commit 642d589

File tree

2 files changed

+593
-253
lines changed

2 files changed

+593
-253
lines changed

packages/blade/src/components/Table/TableHeader.web.tsx

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ const StyledHeaderCell = styled(HeaderCell)<{
124124
? makeSpace(getIn(theme, tableRow.paddingRight[$rowDensity]))
125125
: undefined,
126126
minHeight: makeSize(getIn(size, tableRow.minHeight[$rowDensity])),
127+
'> .text': {
128+
flexGrow: 1,
129+
display: 'flex',
130+
justifyContent: $textAlign,
131+
},
132+
'> .sortIcon': {
133+
flexShrink: 0,
134+
},
127135
},
128136
'&:focus-visible': getFocusRingStyles({ theme, negativeOffset: true }),
129137
},
@@ -162,20 +170,24 @@ const _TableHeaderCell = ({
162170
{...metaAttribute({ name: MetaConstants.TableHeaderCell })}
163171
{...makeAnalyticsAttribute(rest)}
164172
>
165-
{isChildrenString ? (
166-
<Text size="medium" weight="medium" color="surface.text.gray.normal">
167-
{children}
168-
</Text>
169-
) : (
170-
children
171-
)}
173+
<div className="text">
174+
{isChildrenString ? (
175+
<Text size="medium" weight="medium" color="surface.text.gray.normal">
176+
{children}
177+
</Text>
178+
) : (
179+
children
180+
)}
181+
</div>
172182
{isSortable && (
173-
<BaseBox paddingLeft="spacing.2" backgroundColor="transparent">
174-
<SortIcon
175-
isSorted={currentSortedState.sortKey === headerKey}
176-
isSortReversed={currentSortedState.isSortReversed}
177-
/>
178-
</BaseBox>
183+
<div className="sortIcon">
184+
<BaseBox paddingLeft="spacing.2" backgroundColor="transparent">
185+
<SortIcon
186+
isSorted={currentSortedState.sortKey === headerKey}
187+
isSortReversed={currentSortedState.isSortReversed}
188+
/>
189+
</BaseBox>
190+
</div>
179191
)}
180192
</StyledHeaderCell>
181193
);

0 commit comments

Comments
 (0)