Commit 95861d14 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[ERGO] click on name open or close it

parent dd5c6f02
...@@ -75,6 +75,7 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c ...@@ -75,6 +75,7 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c
, chevronIcon isLeaf handed nodeType folderOpen , chevronIcon isLeaf handed nodeType folderOpen
, nodeLink { frontends , nodeLink { frontends
, id , id
, folderOpen
, isSelected: mCurrentRoute , isSelected: mCurrentRoute
== Routes.nodeTypeAppRoute == Routes.nodeTypeAppRoute
nodeType nodeType
......
...@@ -268,6 +268,7 @@ prettyNodeType nt = S.replace (S.Pattern "Node") (S.Replacement " ") ...@@ -268,6 +268,7 @@ prettyNodeType nt = S.replace (S.Pattern "Node") (S.Replacement " ")
type NodeLinkProps = ( type NodeLinkProps = (
frontends :: Frontends frontends :: Frontends
, id :: Int , id :: Int
, folderOpen :: R.State Boolean
, isSelected :: Boolean , isSelected :: Boolean
, name :: Name , name :: Name
, nodeType :: GT.NodeType , nodeType :: GT.NodeType
...@@ -281,11 +282,14 @@ nodeLink p = R.createElement nodeLinkCpt p [] ...@@ -281,11 +282,14 @@ nodeLink p = R.createElement nodeLinkCpt p []
nodeLinkCpt :: R.Component NodeLinkProps nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R2.hooksComponent thisModule "nodeLink" cpt nodeLinkCpt = R2.hooksComponent thisModule "nodeLink" cpt
where where
cpt { frontends, id, isSelected, name, nodeType, session, handed} _ = do cpt { frontends, id, isSelected, name, nodeType, session, handed, folderOpen} _ = do
popoverRef <- R.useRef null popoverRef <- R.useRef null
pure $ pure $
H.div {} [ H.a { data: { for: tooltipId, tip: true } H.div { onClick: R2.effToggler folderOpen }
[ H.a { data: { for: tooltipId
, tip: true
}
, href: url frontends $ GT.NodePath (sessionId session) nodeType (Just id) } , href: url frontends $ GT.NodePath (sessionId session) nodeType (Just id) }
[ nodeText { isSelected [ nodeText { isSelected
, name , name
......
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