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

[LAYOUT] adding layout semantic.

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