Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
b9434715
Commit
b9434715
authored
Apr 22, 2022
by
arturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
>>> continue
parent
36b0f000
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
Router.purs
src/Gargantext/Components/Router.purs
+12
-8
No files found.
src/Gargantext/Components/Router.purs
View file @
b9434715
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment