Commit 5fcbf012 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[mainPage] fix styling for graph explorer/other pages

For other pages, tree needs space on the left.
parent 6e08e46c
module Gargantext.Components.Forest
( forest
-- , forestLayout
-- , forestLayoutWithTopBar
-- , forestLayoutMain
-- , forestLayoutRaw
, forestLayout
, Common
, Props
......@@ -12,14 +8,13 @@ module Gargantext.Components.Forest
import Gargantext.Prelude
import Data.Array as A
import Data.Maybe (Maybe, fromMaybe)
import Data.Maybe (Maybe)
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.Forest.Tree (doSearch, treeLoader)
import Gargantext.Components.TopBar (topBar)
import Gargantext.Components.Forest.Tree (treeLoader)
import Gargantext.Ends (Frontends, Backend)
import Gargantext.Routes (AppRoute)
import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions)
import Gargantext.Types (Handed, reverseHanded, switchHanded)
import Gargantext.Types (Handed, switchHanded)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Reactix as R
......
......@@ -2,7 +2,6 @@ module Gargantext.Components.GraphExplorer where
import Gargantext.Prelude hiding (max,min)
import DOM.Simple.Types (Element)
import Data.Array as A
import Data.FoldableWithIndex (foldMapWithIndex)
import Data.Int (toNumber)
......@@ -12,7 +11,16 @@ import Data.Nullable (null, Nullable)
import Data.Sequence as Seq
import Data.Set as Set
import Data.Tuple (Tuple(..))
import DOM.Simple.Types (Element)
import Effect.Aff (Aff)
import Math as Math
import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix.DOM.HTML as RH
import Record as Record
import Record.Extra as RX
import Toestand as T
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.Graph as Graph
......@@ -32,13 +40,6 @@ import Gargantext.Types as Types
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Math as Math
import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix.DOM.HTML as RH
import Record as Record
import Record.Extra as RX
import Toestand as T
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer"
......
module Gargantext.Components.MainPage where
import Data.Tuple.Nested ((/\))
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Prelude
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Routes as GR
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.MainPage"
type MainPage = ()
-- ( mClassName :: Maybe String )
type MainPage =
(
boxes :: Boxes
)
mainPage :: R2.Component MainPage
mainPage = R.createElement mainPageCpt
mainPageCpt :: R.Component MainPage
mainPageCpt = here.component "mainPage" cpt
where
cpt { } children = do
pure $ H.div {}
[ H.div { id: "page-wrapper" }
[ H.div { className: "container-fluid" } children ]
cpt { boxes: { route } } children = do
route' <- T.useLive T.unequal route
let classNameOffset /\ className = case route' of
GR.PGraphExplorer _ _ -> "" /\ "col-md-12"
_ -> "col-md-2" /\ "col-md-10"
pure $ H.div { className: "row" }
[ H.div { className: classNameOffset } []
, H.div { className }
[ H.div { id: "page-wrapper" }
[ H.div { className: "container-fluid" } children ]
]
]
......@@ -5,6 +5,12 @@ import Gargantext.Prelude
import Data.Array as A
import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\))
import Reactix as R
import Reactix.DOM.HTML as H
import Record as Record
import Record.Extra as RE
import Toestand as T
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.Footer (footer)
import Gargantext.Components.Forest as Forest
......@@ -34,11 +40,6 @@ import Gargantext.Sessions (Session, WithSession)
import Gargantext.Sessions as Sessions
import Gargantext.Types (CorpusId, Handed(..), ListId, NodeID, NodeType(..), SessionId, SidePanelState(..), reverseHanded)
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Record as Record
import Record.Extra as RE
import Toestand as T
here :: R2.Here
here = R2.here "Gargantext.Components.Router"
......@@ -101,71 +102,7 @@ mainPage = R.createElement mainPageCpt
mainPageCpt :: R.Component Props
mainPageCpt = here.component "mainPage" cpt where
cpt { boxes } _ = do
pure $ MainPage.mainPage {} [ renderRoute { boxes }
[] ]
pure $ MainPage.mainPage { boxes } [ renderRoute { boxes } [] ]
forest :: R2.Component Props
forest = R.createElement forestCpt
......
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