Skip to content

Commit

Permalink
docs(ColorsTable): fixes color and hover effect (#2122)
Browse files Browse the repository at this point in the history
  • Loading branch information
langz authored and tujoworker committed May 31, 2023
1 parent 239c239 commit c82f570
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/dnb-design-system-portal/src/shared/tags/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class Table extends React.PureComponent {
child.type === 'table' ? child.props.children : false
) || this.props.children

// manipulate the colors, if providet
// manipulate the colors, if provided
children = recursiveMap(children, (child, isValid) => {
if (!isValid && typeof child === 'string') {
const checkChild = String(child).trim()
Expand All @@ -35,7 +35,7 @@ export default class Table extends React.PureComponent {
}

// in case we will color the whole td
if (child.props.originalType === 'td') {
if (child.type === 'td') {
const hex = child.props.color ? child.props.color : null
if (hex && hex.length === 7) {
return (
Expand All @@ -55,11 +55,11 @@ export default class Table extends React.PureComponent {
}
}

if (child.props.originalType === 'th') {
if (child.type === 'th') {
return <Th>{getChildren(child)}</Th>
}

if (child.props.originalType === 'tr') {
if (child.type === 'tr') {
return <Tr>{getChildren(child)}</Tr>
}

Expand Down

0 comments on commit c82f570

Please sign in to comment.