Commit 7e6102b9 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[mainPage] fixes to handed layout

parent 5fcbf012
module Gargantext.Components.MainPage where module Gargantext.Components.MainPage where
import Gargantext.Prelude
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
import Web.HTML.Event.EventTypes (offline)
import Gargantext.Prelude
import Gargantext.Components.App.Data (Boxes) import Gargantext.Components.App.Data (Boxes)
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
here :: R2.Here here :: R2.Here
...@@ -24,17 +26,22 @@ mainPage = R.createElement mainPageCpt ...@@ -24,17 +26,22 @@ mainPage = R.createElement mainPageCpt
mainPageCpt :: R.Component MainPage mainPageCpt :: R.Component MainPage
mainPageCpt = here.component "mainPage" cpt mainPageCpt = here.component "mainPage" cpt
where where
cpt { boxes: { route } } children = do cpt { boxes: { handed
, route } } children = do
handed' <- T.useLive T.unequal handed
route' <- T.useLive T.unequal route route' <- T.useLive T.unequal route
let classNameOffset /\ className = case route' of let classNameOffsetPre /\ className /\ classNameOffsetPost = case route' of
GR.PGraphExplorer _ _ -> "" /\ "col-md-12" GR.PGraphExplorer _ _ -> "" /\ "col-md-12" /\ ""
_ -> "col-md-2" /\ "col-md-10" _ -> case handed' of
GT.LeftHanded -> "" /\ "col-md-10" /\ "col-md-2"
GT.RightHanded -> "col-md-2" /\ "col-md-10" /\ ""
pure $ H.div { className: "row" } pure $ H.div { className: "row" }
[ H.div { className: classNameOffset } [] [ H.div { className: classNameOffsetPre } []
, H.div { className } , H.div { className }
[ H.div { id: "page-wrapper" } [ H.div { id: "page-wrapper" }
[ H.div { className: "container-fluid" } children ] [ H.div { className: "container-fluid" } children ]
] ]
, H.div { className: classNameOffsetPost } []
] ]
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