Commit 239057d5 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[TREE] some options to add in the tree (css).

parent ac100325
......@@ -197,23 +197,36 @@ exampleTree =
------------------------------------------------------------------------
-- TODO
-- alignment to the right
nodeOptionsCorp = [ i [className "fab fa-whmcs" ] []]
-- TODO
-- alignment to the right
-- on hover make other options available:
nodeOptionsView = [ i [className "fas fa-sync-alt" ] []
, i [className "fas fa-upload" ] []
, i [className "fas fa-share-alt"] []
]
toHtml :: _ -> FTree -> ReactElement
toHtml d (NLeaf (Tuple name link)) =
li []
[ a [ href link]
[ text name
]
( [ text (name <> " ")
] <> nodeOptionsView
)
]
toHtml d (NNode id open name ary) =
ul [ ]
[ li [] $
[ a [onClick $ (\e-> d $ ToggleFolder id)] [i [fldr open] []]
, text $ " " <> name
] <>
( [ a [onClick $ (\e-> d $ ToggleFolder id)] [i [fldr open] []]
, text $ " " <> name <> " "
] <> nodeOptionsCorp <>
if open then
map (toHtml d) ary
else []
)
]
fldr :: Boolean -> Props
......
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