Commit e87d7977 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[LAYOUT] adding layout semantic.

parent dfb784a8
......@@ -89,8 +89,8 @@ performAction GO _ _ = void do
addcorpusviewSpec :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
addcorpusviewSpec = simpleSpec performAction render
layoutAddcorpus :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
layoutAddcorpus = simpleSpec performAction render
where
render :: Render State props Action
render dispatch _ state _ =
......
......@@ -34,7 +34,7 @@ import Unsafe.Coerce (unsafeCoerce)
main :: forall e. Eff (dom:: DOM, console :: CONSOLE, ajax :: AJAX | e) Unit
main = do
case createReactSpec spec tdata of
case createReactSpec layoutDocview tdata of
{ spec, dispatcher } -> void $ do
document <- DOM.window >>= DOM.document
container <- unsafePartial (fromJust <$> DOM.querySelector (QuerySelector "#app") (DOM.htmlDocumentToParentNode document))
......@@ -111,8 +111,8 @@ toggleNode sid (NNode iid open name ary) =
toggleNode sid a = a
spec :: Spec _ State _ Action
spec = simpleSpec performAction render
layoutDocview :: Spec _ State _ Action
layoutDocview = simpleSpec performAction render
where
render :: Render State _ Action
render dispatch _ state@(TableData d) _ =
......
......@@ -97,8 +97,8 @@ imageEnter action = div [className "row"]
]
home :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
home = simpleSpec performAction render
layoutHome :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
layoutHome = simpleSpec performAction render
where
render :: Render State props Action
render dispatch _ state _ =
......
......@@ -147,19 +147,21 @@ pagesComponent s =
| eff
) AppState props Action
selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec Home = wrap $ focus _landingState _landingAction L.home
selectSpec AddCorpus = wrap $ focus _addCorpusState _addCorpusAction AC.addcorpusviewSpec
selectSpec DocView = wrap $ focus _docViewState _docViewAction DV.spec
selectSpec SearchView = wrap $ focus _searchState _searchAction S.searchSpec
selectSpec UserPage = wrap $ focus _userPageState _userPageAction UP.userPageSpec
selectSpec Home = layout0 $ focus _landingState _landingAction L.layoutHome
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec DocView = layout0 $ focus _docViewState _docViewAction DV.layoutDocview
selectSpec UserPage = layout0 $ focus _userPageState _userPageAction UP.layoutUser
-- To be removed
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
routingSpec :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
routingSpec = simpleSpec performAction defaultRender
wrap :: forall eff props. Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
wrap spec =
layout0 :: forall eff props. Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
layout0 spec =
fold
[ sidebarnavSpec
-- TODO Add Tree to the template
......
......@@ -28,12 +28,12 @@ performAction NoOp _ _ = void do
modifyState id
userPageSpec :: forall props eff . Spec ( console :: CONSOLE
layoutUser :: forall props eff . Spec ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
userPageSpec = simpleSpec performAction render
layoutUser = simpleSpec performAction render
where
render :: Render State props Action
render dispatch _ state _ =
......
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