Code plus propre

pull/337/head
Mael 2018-09-07 16:22:23 +02:00
parent fc2cf8db95
commit 64ac9c3cbd
1 changed files with 3 additions and 7 deletions

View File

@ -15,15 +15,11 @@ export default function Variations(nodeValue, explanation) {
{explanation.map(({ condition, consequence, satisfied }) => (
<li
className={classNames('variation', { satisfied })}
key={JSON.stringify(condition | 'sinon')}>
key={JSON.stringify(condition || 'sinon')}>
<div className="condition">
{condition && (
<>
<span>Si</span> {makeJsx(condition)}
</>
)}
{condition && <span>Si {makeJsx(condition)}</span>}
<div className="consequence">
<span>{condition ? 'Alors : ' : 'Sinon : '}</span>
{condition ? 'Alors : ' : 'Sinon : '}
<span className="content">{makeJsx(consequence)}</span>
</div>
</div>