From c82f57074d9059608b3512eb6879aefddd869454 Mon Sep 17 00:00:00 2001 From: Anders Date: Tue, 21 Mar 2023 13:28:21 +0100 Subject: [PATCH] docs(ColorsTable): fixes color and hover effect (#2122) --- .../dnb-design-system-portal/src/shared/tags/Table.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dnb-design-system-portal/src/shared/tags/Table.js b/packages/dnb-design-system-portal/src/shared/tags/Table.js index 344e53cfb5e..36b77899f98 100644 --- a/packages/dnb-design-system-portal/src/shared/tags/Table.js +++ b/packages/dnb-design-system-portal/src/shared/tags/Table.js @@ -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() @@ -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 ( @@ -55,11 +55,11 @@ export default class Table extends React.PureComponent { } } - if (child.props.originalType === 'th') { + if (child.type === 'th') { return {getChildren(child)} } - if (child.props.originalType === 'tr') { + if (child.type === 'tr') { return {getChildren(child)} }