Commit 766eac60 authored by James Laver's avatar James Laver Committed by Alexandre Delanoë

Move to use new DOM functions

parent 6e7406ac
...@@ -44,7 +44,7 @@ annotatedField = R.createLeaf annotatedFieldComponent ...@@ -44,7 +44,7 @@ annotatedField = R.createLeaf annotatedFieldComponent
annotatedFieldComponent :: R.Component Props annotatedFieldComponent :: R.Component Props
annotatedFieldComponent = R.pureLeaf "AnnotatedField" cpt annotatedFieldComponent = R.pureLeaf "AnnotatedField" cpt
where where
cpt props = R.createDOMElement "p" { className: "annotated-field" } $ children props cpt props = RDOM.p { className: "annotated-field" } $ children props
children props = A.fromFoldable (annotateRun <$> compile props) children props = A.fromFoldable (annotateRun <$> compile props)
type RunProps = ( list :: Maybe TermList, text :: String ) type RunProps = ( list :: Maybe TermList, text :: String )
...@@ -55,8 +55,8 @@ annotateRun (Tuple text list) = R.createLeaf annotatedRunComponent { text, list ...@@ -55,8 +55,8 @@ annotateRun (Tuple text list) = R.createLeaf annotatedRunComponent { text, list
annotatedRunComponent :: R.Component RunProps annotatedRunComponent :: R.Component RunProps
annotatedRunComponent = R.pureLeaf "AnnotatedRun" cpt annotatedRunComponent = R.pureLeaf "AnnotatedRun" cpt
where cpt { text, list } = maybe (unstyled text) (styled text) list where cpt { text, list } = maybe (unstyled text) (styled text) list
styled text list = R.createDOMElement "span" { style: termStyle list } [ RDOM.text text ] styled text list = RDOM.span { style: termStyle list } [ RDOM.text text ]
unstyled text = R.createDOMElement "span" {} [ RDOM.text text ] unstyled text = RDOM.span {} [ RDOM.text text ]
compile :: Record Props -> List Run compile :: Record Props -> List Run
compile props = runs props.text compile props = runs props.text
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment