Commit 24eaa34e authored by Abinaya Sudhir's avatar Abinaya Sudhir

Tabview with search query added

parent e93b4c09
module CorpusAnalysis where module CorpusAnalysis where
import Control.Monad.Eff.Console (CONSOLE) import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM) import DOM (DOM)
import Data.Array (fold)
import Network.HTTP.Affjax (AJAX) import Network.HTTP.Affjax (AJAX)
import Prelude (id, void) import Prelude (id, void)
import Prelude hiding (div) import Prelude hiding (div)
import React.DOM (div, h3, hr, i, p, span, text) import React.DOM (div, h3, hr, i, p, span, text)
import React.DOM.Props (className, style) import React.DOM.Props (className, style)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec) import Tabview as Tab
import Thermite (PerformAction, Render, Spec, defaultPerformAction, modifyState, simpleSpec)
type State = Tab.State
type State = String type Action = Tab.Action
initialState :: State initialState :: State
initialState = "" initialState = Tab.initialState
data Action = NoOp spec' :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) Tab.State props Tab.Action
spec' = fold [corpusAnalysisSpec, Tab.tab1]
performAction :: forall eff props. PerformAction ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
performAction NoOp _ _ = void do
modifyState id
corpusAnalysisSpec :: forall props eff . Spec eff Tab.State props Tab.Action
corpusAnalysisSpec :: forall props eff . Spec ( console :: CONSOLE corpusAnalysisSpec = simpleSpec defaultPerformAction render
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
corpusAnalysisSpec = simpleSpec performAction render
where where
render :: Render State props Action render :: Render Tab.State props Tab.Action
render dispatch _ state _ = render dispatch _ state _ =
[ div [className "row"] [ div [className "row"]
[ div [className "col-md-3"] [ div [className "col-md-3"]
......
...@@ -228,7 +228,7 @@ pagesComponent s = ...@@ -228,7 +228,7 @@ pagesComponent s =
, dom :: DOM , dom :: DOM
| eff | eff
) AppState props Action ) AppState props Action
selectSpec CorpusAnalysis = layout0 $ focus _corpusState _corpusAction CA.corpusAnalysisSpec selectSpec CorpusAnalysis = layout0 $ focus _corpusState _corpusAction CA.spec'
selectSpec Login = focus _loginState _loginAction LN.renderSpec selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec Home = layout0 $ focus _landingState _landingAction (L.layoutLanding EN) selectSpec Home = layout0 $ focus _landingState _landingAction (L.layoutLanding EN)
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
...@@ -554,5 +554,5 @@ dispatchAction dispatcher _ Tabview = do ...@@ -554,5 +554,5 @@ dispatchAction dispatcher _ Tabview = do
dispatchAction dispatcher _ CorpusAnalysis = do dispatchAction dispatcher _ CorpusAnalysis = do
_ <- dispatcher $ SetRoute $ CorpusAnalysis _ <- dispatcher $ SetRoute $ CorpusAnalysis
_ <- dispatcher $ CorpusAnalysisA $ CA.NoOp --_ <- dispatcher $ CorpusAnalysisA $ CA.NoOp
pure unit pure unit
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