Commit b3bf8672 authored by Mael NICOLAS's avatar Mael NICOLAS

first commit starting to create fake dashboard view

parent 55d5f541
module Dashboard where
import DOM (DOM)
import Data.Unit (Unit)
import Prelude (pure, unit, void)
import React.DOM (text)
import Thermite (PerformAction, Render, Spec, simpleSpec)
type State = Unit
data Action = None
initialState :: State
initialState = unit
performAction :: forall eff props. PerformAction (dom :: DOM | eff) State props Action
performAction _ _ _ = pure unit
render :: forall props. Render State props Action
render dispatch _ state _ = [text "Dashboard"]
layoutDashboard :: forall props eff. Spec (dom :: DOM | eff) State props Action
layoutDashboard = simpleSpec performAction render
...@@ -32,6 +32,7 @@ import Tabview as TV ...@@ -32,6 +32,7 @@ import Tabview as TV
import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultRender, focus, modifyState, simpleSpec, withState) import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultRender, focus, modifyState, simpleSpec, withState)
import Unsafe.Coerce (unsafeCoerce) import Unsafe.Coerce (unsafeCoerce)
import UserPage as UP import UserPage as UP
import Dashboard as Dsh
type E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e) type E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e)
...@@ -48,6 +49,7 @@ type AppState = ...@@ -48,6 +49,7 @@ type AppState =
, tabview :: TV.State , tabview :: TV.State
, search :: String , search :: String
, corpusAnalysis :: CA.State , corpusAnalysis :: CA.State
, dashboard :: Dsh.State
} }
initAppState :: AppState initAppState :: AppState
...@@ -64,6 +66,7 @@ initAppState = ...@@ -64,6 +66,7 @@ initAppState =
, tabview : TV.initialState , tabview : TV.initialState
, search : "" , search : ""
, corpusAnalysis : CA.initialState , corpusAnalysis : CA.initialState
, dashboard : Dsh.initialState
} }
data Action data Action
...@@ -214,7 +217,6 @@ _corpusAction = prism CorpusAnalysisA \action -> ...@@ -214,7 +217,6 @@ _corpusAction = prism CorpusAnalysisA \action ->
CorpusAnalysisA caction -> Right caction CorpusAnalysisA caction -> Right caction
_-> Left action _-> Left action
pagesComponent :: forall props eff. AppState -> Spec (E eff) AppState props Action pagesComponent :: forall props eff. AppState -> Spec (E eff) AppState props Action
pagesComponent s = pagesComponent s =
case s.currentRoute of case s.currentRoute of
......
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