Terms.purs 1.05 KB
Newer Older
Sudhir Kumar's avatar
Sudhir Kumar committed
1
module Gargantext.Pages.Corpus.Doc.Facets.Terms where
2 3 4

import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
Abinaya Sudhir's avatar
Abinaya Sudhir committed
5
import Data.Array (fold)
6
import Gargantext.Pages.Corpus.Doc.Document as D
7 8
import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div)
Abinaya Sudhir's avatar
Abinaya Sudhir committed
9 10
import React.DOM (h3, text)
import Thermite (PerformAction, Render, Spec, defaultPerformAction, modifyState, simpleSpec)
11 12 13



Abinaya Sudhir's avatar
Abinaya Sudhir committed
14
type State = D.State
15 16


Abinaya Sudhir's avatar
Abinaya Sudhir committed
17 18
initialState :: D.State
initialState = D.tdata
19

Abinaya Sudhir's avatar
Abinaya Sudhir committed
20
type Action = D.Action
21 22 23 24 25 26 27


termsSpec :: forall props eff . Spec ( console :: CONSOLE
                                        , ajax    :: AJAX
                                        , dom     :: DOM
                                        | eff
                                        ) State props Action
Abinaya Sudhir's avatar
Abinaya Sudhir committed
28
termsSpec = simpleSpec defaultPerformAction render
29 30 31
  where
    render :: Render State props Action
    render dispatch _ state _ =
Abinaya Sudhir's avatar
Abinaya Sudhir committed
32 33 34 35
      [ h3 [] [text "Terms view"]]

termSpec' :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
termSpec' = fold [termsSpec, D.layoutDocview]