Commit b9434715 authored by arturo's avatar arturo

>>> continue

parent 36b0f000
...@@ -38,6 +38,7 @@ import Gargantext.Routes as GR ...@@ -38,6 +38,7 @@ import Gargantext.Routes as GR
import Gargantext.Sessions (Session, WithSession) 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(..)) import Gargantext.Types (CorpusId, Handed(..), ListId, NodeID, NodeType(..), SessionId, SidePanelState(..))
import Gargantext.Utils ((?))
import Gargantext.Utils.Reactix (getElementById) import Gargantext.Utils.Reactix (getElementById)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R import Reactix as R
...@@ -62,11 +63,10 @@ router :: R2.Leaf Props ...@@ -62,11 +63,10 @@ router :: R2.Leaf Props
router = R2.leafComponent routerCpt router = R2.leafComponent routerCpt
routerCpt :: R.Component Props routerCpt :: R.Component Props
routerCpt = here.component "router" cpt where routerCpt = here.component "router" cpt where
cpt { boxes: boxes@{ handed, showLogin, showTree } } _ = do cpt { boxes: boxes@{ handed, showLogin } } _ = do
-- States -- States
handed' <- R2.useLive' handed handed' <- R2.useLive' handed
showLogin' <- R2.useLive' showLogin showLogin' <- R2.useLive' showLogin
showTree' <- R2.useLive' showTree
-- Effects -- Effects
let let
...@@ -99,11 +99,7 @@ routerCpt = here.component "router" cpt where ...@@ -99,11 +99,7 @@ routerCpt = here.component "router" cpt where
[ [
-- @XXX: ReactJS lack of "keep-alive" feature workaround solution -- @XXX: ReactJS lack of "keep-alive" feature workaround solution
-- @link https://github.com/facebook/react/issues/12039 -- @link https://github.com/facebook/react/issues/12039
-- ↓ forest { boxes }
-- @XXX: ReactJS "display: none" don't exec effect cleaning function
-- (therefore cannot use the simple "display: none" workaround
-- to keep below component alive)
R2.if' (showTree') $ forest { boxes }
, ,
mainPage { boxes } mainPage { boxes }
, ,
...@@ -208,9 +204,13 @@ mainPageCpt = here.component "mainPage" cpt where ...@@ -208,9 +204,13 @@ mainPageCpt = here.component "mainPage" cpt where
forest :: R2.Leaf Props forest :: R2.Leaf Props
forest = R2.leaf forestCpt forest = R2.leaf forestCpt
forestCpt :: R.Memo Props forestCpt :: R.Memo Props
forestCpt = R.memo' $ here.component "forest" cpt where forestCpt = R.memo' $ here.component "forest" cpt where
cpt { boxes } _ = do cpt { boxes } _ = do
-- States
showTree' <- R2.useLive' boxes.showTree
-- Hooks -- Hooks
resizeHandler <- useResizeHandler resizeHandler <- useResizeHandler
...@@ -223,7 +223,11 @@ forestCpt = R.memo' $ here.component "forest" cpt where ...@@ -223,7 +223,11 @@ forestCpt = R.memo' $ here.component "forest" cpt where
pure $ pure $
H.div H.div
{ className: "router__aside" } { className: intercalate " "
[ "router__aside"
, showTree' ? "" $ "d-none"
]
}
[ [
forestLayout forestLayout
{ boxes { boxes
......
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