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