Skip to content

Commit c0a491c

Browse files
authored
Update the join token table style (#62542)
Mute the text in the disabled row. This requires an override because the table itself hard codes the color in the <td> styles.
1 parent 18a683b commit c0a491c

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

web/packages/teleport/src/JoinTokens/JoinTokens.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ export const JoinTokens = () => {
9292

9393
function getRowStyle(row: JoinToken): React.CSSProperties {
9494
if (row.isCloudSystem) {
95-
return { background: theme.colors.interactive.tonal.neutral[0] };
95+
return {
96+
background: theme.colors.interactive.tonal.neutral[0],
97+
color: theme.colors.text.muted,
98+
};
9699
}
97100
}
98101

@@ -184,7 +187,7 @@ export const JoinTokens = () => {
184187
<Alert kind="danger">{joinTokensAttempt.statusText}</Alert>
185188
)}
186189
{joinTokensAttempt.status === 'success' && (
187-
<Table
190+
<JoinTokenTable
188191
isSearchable
189192
data={joinTokensAttempt.data.items}
190193
row={{
@@ -324,6 +327,15 @@ export const JoinTokens = () => {
324327
);
325328
};
326329

330+
// This is necessary because the Table component styles
331+
// hard-code the text color for the <td> element, preventing
332+
// our row style from being applied.
333+
const JoinTokenTable = styled(Table)`
334+
& > tbody > tr > td {
335+
color: inherit;
336+
}
337+
` as typeof Table;
338+
327339
export function searchMatcher(
328340
targetValue: any,
329341
searchValue: string,
@@ -384,7 +396,7 @@ const StyledLabel = styled(Label)`
384396
margin: 1px 0;
385397
margin-right: ${props => props.theme.space[2]}px;
386398
background-color: ${props => props.theme.colors.interactive.tonal.neutral[0]};
387-
color: ${props => props.theme.colors.text.main};
399+
color: inherit;
388400
overflow: hidden;
389401
text-overflow: ellipsis;
390402
white-space: nowrap;

0 commit comments

Comments
 (0)