[node] implement Node/Tooltip to separate things

This was implemented by me some time ago, but I forgot to commit it.
parent 82f8b36c
Pipeline #7777 failed with stages
in 22 minutes and 17 seconds
......@@ -26,6 +26,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload.Types (FileType(..),
import Gargantext.Components.Forest.Tree.Node.Box (nodePopupView)
import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), settingsBox)
import Gargantext.Components.Forest.Tree.Node.Tools.Sync (nodeActionsGraph, nodeActionsNodeList)
import Gargantext.Components.Forest.Tree.Node.Tooltip (nodeTooltip, tooltipId)
import Gargantext.Components.GraphExplorer.API as GraphAPI
import Gargantext.Components.Lang (Lang(EN))
import Gargantext.Components.Nodes.Corpus.Types (CorpusData)
......@@ -578,42 +579,6 @@ truncateNodeUser = Regex.match (nodeUserRegexp) >=> flip NArray.index 1 >>> join
---------------------------------------------------
type NodeTooltipProps =
( name :: String
, id :: GT.NodeID
, nodeType :: GT.NodeType
)
nodeTooltip :: R2.Component NodeTooltipProps
nodeTooltip = R2.component nodeTooltipCpt
nodeTooltipCpt :: R.Component NodeTooltipProps
nodeTooltipCpt = here.component "nodeTooltip" cpt
where
cpt { name, id, nodeType } children = pure
$ B.tooltip
{ id: tooltipId name id
, effect: FloatEffect
, delayShow: 600
}
$
[ H.b
{}
[ B.icon
{ name: GT.getIcon nodeType true }
, B.span_ $
GT.prettyNodeType nodeType
]
, B.div_ $
name
]
<> children
tooltipId :: String -> GT.NodeID -> String
tooltipId name id = name <> "-node-link-" <> show id
---------------------------------------------------------
blankNodeSpan :: R2.Leaf ()
blankNodeSpan = R2.leaf blankNodeSpanCpt
......
module Gargantext.Components.Forest.Tree.Node.Tooltip where
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (TooltipEffect(FloatEffect))
import Gargantext.Prelude
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Tooltip"
type NodeTooltipProps =
( name :: String
, id :: GT.NodeID
, nodeType :: GT.NodeType
)
nodeTooltip :: R2.Component NodeTooltipProps
nodeTooltip = R2.component nodeTooltipCpt
nodeTooltipCpt :: R.Component NodeTooltipProps
nodeTooltipCpt = here.component "nodeTooltip" cpt
where
cpt { name, id, nodeType } children = pure
$ B.tooltip
{ id: tooltipId name id
, effect: FloatEffect
, delayShow: 2000
, delayHide: 2000
}
$
[ H.b
{}
[ B.icon
{ name: GT.getIcon nodeType true }
, B.span_ $
GT.prettyNodeType nodeType
]
, B.div_ $
name
]
<> children
tooltipId :: String -> GT.NodeID -> String
tooltipId name id = name <> "-node-link-" <> show id
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