From 64a4e855072c4d47ac980d236c1f2c45743b336c Mon Sep 17 00:00:00 2001 From: mama Date: Fri, 13 Oct 2017 12:36:25 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9composition=20du=20composant=20Somme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/engine/mecanismViews/Somme.js | 75 ++++++++++++++-------------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/source/engine/mecanismViews/Somme.js b/source/engine/mecanismViews/Somme.js index 7e2c99830..3066e1da0 100644 --- a/source/engine/mecanismViews/Somme.js +++ b/source/engine/mecanismViews/Somme.js @@ -4,47 +4,46 @@ import {path} from 'ramda' import {Node, NodeValue} from './common' -export default class Somme extends Component { - render() { - let {explanation, nodeValue} = this.props - return + } /> - } - renderTable = explanation => ( - - - {explanation.map((v, i) => { - let rowFormula = path(["explanation", "formule", "explanation"], v), - isSomme = rowFormula && rowFormula.name == "somme" - return [ - - - - - , - ...(isSomme - ? [ - - - - ] - : []) - ] - })} - -
-
{i != 0 && "+"}{makeJsx(v)} - -
- - {this.renderTable(rowFormula.explanation)} -
- ) +let Table = ({explanation}) => + + {explanation.map((v, i) => )} + +
+
+ + +class Row extends Component { + render() { + let {v, i} = this.props, + rowFormula = path(["explanation", "formule", "explanation"], v), + isSomme = rowFormula && rowFormula.name == "somme" + + return [ + + {i != 0 && "+"} + {makeJsx(v)} + + + + , + ...(isSomme + ? [ + + + + + + + ] + : []) + ] + } }