🐛 Affichage d'une valeur quand elle est nulle
parent
4785155f25
commit
633b213869
|
@ -39,6 +39,17 @@ export default withLanguage(
|
|||
}) => {
|
||||
/* Either an entire rule object is passed, or just the right attributes and the value as a JSX child*/
|
||||
let nodeValue = value === undefined ? children : value
|
||||
|
||||
if (
|
||||
(nilValueSymbol !== undefined && nodeValue === 0) ||
|
||||
Number.isNaN(nodeValue) ||
|
||||
nodeValue === null
|
||||
)
|
||||
return (
|
||||
<span css={style} className="value">
|
||||
-
|
||||
</span>
|
||||
)
|
||||
let valueType = typeof nodeValue,
|
||||
unitText =
|
||||
unit !== null && (typeof unit == 'object' ? serialiseUnit(unit) : unit),
|
||||
|
@ -59,16 +70,6 @@ export default withLanguage(
|
|||
</>
|
||||
)
|
||||
|
||||
if (
|
||||
(nilValueSymbol !== undefined && nodeValue === 0) ||
|
||||
Number.isNaN(nodeValue)
|
||||
)
|
||||
return (
|
||||
<span css={style} className="value">
|
||||
-
|
||||
</span>
|
||||
)
|
||||
|
||||
return nodeValue == undefined ? null : (
|
||||
<span css={style} className="value">
|
||||
{negative ? '-' : ''}
|
||||
|
|
|
@ -63,7 +63,6 @@ export default compose(
|
|||
namespaceRules = findRuleByNamespace(flatRules, dottedName)
|
||||
|
||||
let displayedRule = analysedExample || analysedRule
|
||||
console.log('dr', displayedRule)
|
||||
return (
|
||||
<>
|
||||
{this.state.viewSource ? (
|
||||
|
|
Loading…
Reference in New Issue