Commit 6f470f3c authored by Abinaya Sudhir's avatar Abinaya Sudhir
parents 76e18024 dd5645c9
...@@ -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,29 +147,31 @@ pagesComponent s = ...@@ -147,29 +147,31 @@ 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 layout =
fold fold
[ sidebarnavSpec [ layoutSidebar
-- TODO Add Tree to the template -- TODO Add layoutTree
--, exampleTree' --, exampleTree'
, innerContainer $ spec , innerLayout $ layout
, footerLegalInfo , layoutFooter
] ]
where where
innerContainer :: Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action innerLayout :: Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
innerContainer = over _render \render d p s c -> innerLayout = over _render \render d p s c ->
[ div [_id "page-wrapper"] [ div [_id "page-wrapper"]
[ [
div [className "container-fluid"] (render d p s c) div [className "container-fluid"] (render d p s c)
...@@ -183,8 +185,8 @@ wrap spec = ...@@ -183,8 +185,8 @@ wrap spec =
-- render dispatch _ state _ = DV.toHtml dispatch DV.exampleTree -- render dispatch _ state _ = DV.toHtml dispatch DV.exampleTree
sidebarnavSpec :: forall props eff. Spec (dom :: DOM |eff) AppState props Action layoutSidebar :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
sidebarnavSpec = simpleSpec performAction render layoutSidebar = simpleSpec performAction render
where where
render :: Render AppState props Action render :: Render AppState props Action
render dispatch _ state _ = render dispatch _ state _ =
...@@ -333,8 +335,8 @@ divDropdownRight = ul [className "nav navbar-nav pull-right"] ...@@ -333,8 +335,8 @@ divDropdownRight = ul [className "nav navbar-nav pull-right"]
footerLegalInfo :: forall props eff. Spec (dom :: DOM |eff) AppState props Action layoutFooter :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
footerLegalInfo = simpleSpec performAction render layoutFooter = simpleSpec performAction render
where where
render :: Render AppState props Action render :: Render AppState props Action
render dispatch _ state _ = [div [ className "container" ] [ hr [] [], footerLegalInfo']] render dispatch _ state _ = [div [ className "container" ] [ hr [] [], footerLegalInfo']]
......
...@@ -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