🐛 Affichage d'une valeur quand elle est nulle

pull/481/head
Mael 2019-07-09 10:57:36 +02:00
parent 4785155f25
commit 633b213869
2 changed files with 11 additions and 11 deletions

View File

@ -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 ? '-' : ''}

View File

@ -63,7 +63,6 @@ export default compose(
namespaceRules = findRuleByNamespace(flatRules, dottedName)
let displayedRule = analysedExample || analysedRule
console.log('dr', displayedRule)
return (
<>
{this.state.viewSource ? (