Commit d92a4e39 authored by James Laver's avatar James Laver

Add background term styling to G.C.Annotated.AnnotatedField

parent c37fe031
...@@ -24,10 +24,11 @@ import Effect.Class.Console (log) ...@@ -24,10 +24,11 @@ import Effect.Class.Console (log)
import Effect.Unsafe (unsafePerformEffect) import Effect.Unsafe (unsafePerformEffect)
import React (ReactElement, ReactClass, createElement) import React (ReactElement, ReactClass, createElement)
import React.DOM (p, span, text) import React.DOM (p, span, text)
import React.DOM.Props (className, onContextMenu) import React.DOM.Props as Props
import React.DOM.Props (className, onContextMenu, style)
import Thermite (PerformAction, Render, createReactSpec, simpleSpec, writeState) import Thermite (PerformAction, Render, createReactSpec, simpleSpec, writeState)
import Gargantext.Types (TermList) import Gargantext.Types (TermList(..))
import Gargantext.Components.NgramsTable (NgramsTable(..), highlightNgrams, termStyle) import Gargantext.Components.NgramsTable (NgramsTable(..), highlightNgrams)
import Gargantext.Utils.React (WithChildren) import Gargantext.Utils.React (WithChildren)
import Gargantext.Utils.Selection (getSelection, toString) import Gargantext.Utils.Selection (getSelection, toString)
import React as React import React as React
...@@ -122,6 +123,11 @@ contextMenuHandler d e = ...@@ -122,6 +123,11 @@ contextMenuHandler d e =
y <- pageY e y <- pageY e
pure $ PageOffset { x, y } pure $ PageOffset { x, y }
termStyle :: TermList -> Props.Props
termStyle GraphTerm = style {backgroundColor: "green"}
termStyle StopTerm = style {backgroundColor: "red", textDecoration : "line-through"}
termStyle CandidateTerm = style {backgroundColor: "black"}
_runs :: Lens' State (List Run) _runs :: Lens' State (List Run)
_runs = lens (\a -> a.runs) (\a r -> a { runs = r }) _runs = lens (\a -> a.runs) (\a r -> a { runs = r })
......
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