Commit 84b97575 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FACTO] nav sidebar almost done.

parent a67cfce8
...@@ -246,16 +246,24 @@ divDropdownLeft = divDropdownLeft' (LiNav { title : "About Gargantext" ...@@ -246,16 +246,24 @@ divDropdownLeft = divDropdownLeft' (LiNav { title : "About Gargantext"
} }
) )
divDropdownLeft' :: LiNav -> ReactElement divDropdownLeft' :: LiNav -> ReactElement
divDropdownLeft' (LiNav { title: title' divDropdownLeft' mb = ul [className "nav navbar-nav"]
[ ul [className "nav navbar-nav pull-left"]
[ li [className "dropdown"]
[ menuButton mb
, menuElements'
]
]
]
menuButton :: LiNav -> ReactElement
menuButton (LiNav { title : title'
, href : href' , href : href'
, icon : icon' , icon : icon'
, text : text' , text : text'
} }) = a [ className "dropdown-toggle navbar-text"
) = ul [className "nav navbar-nav"]
[ ul [className "nav navbar-nav pull-left"]
[ li [className "dropdown"]
[ a [ className "dropdown-toggle navbar-text"
, _data {toggle: "dropdown"} , _data {toggle: "dropdown"}
, href href', role "button" , href href', role "button"
, title title' , title title'
...@@ -264,15 +272,11 @@ divDropdownLeft' (LiNav { title: title' ...@@ -264,15 +272,11 @@ divDropdownLeft' (LiNav { title: title'
] [] ] []
, text (" " <> text') , text (" " <> text')
] ]
, ul [className "dropdown-menu"] divLeftdropdownElements
]
]
]
-- | WYSIWYG example in Pure React ? -- | WYSIWYG example in Pure React ?
divLeftdropdownElements :: Array ReactElement menuElements' :: ReactElement
divLeftdropdownElements = menu -- title, icon, text menuElements' = menuElements-- title, icon, text
[ -- =========================================================== [ -- ===========================================================
[ LiNav { title : "Quick start, tutorials and methodology" [ LiNav { title : "Quick start, tutorials and methodology"
, href : "https://iscpif.fr/gargantext/your-first-map/" , href : "https://iscpif.fr/gargantext/your-first-map/"
...@@ -307,19 +311,22 @@ divLeftdropdownElements = menu -- title, icon, text ...@@ -307,19 +311,22 @@ divLeftdropdownElements = menu -- title, icon, text
] -- =========================================================== ] -- ===========================================================
-- | Menu in the sidebar, syntactic sugar -- | Menu in the sidebar, syntactic sugar
menu :: Array (Array LiNav) -> Array ReactElement menuElements :: Array (Array LiNav) -> ReactElement
menu ns = intercalate divider $ map (map liNav) ns menuElements ns = dropDown $ intercalate divider $ map (map liNav) ns
where where
dropDown :: Array ReactElement -> ReactElement
dropDown = ul [className "dropdown-menu"]
divider :: Array ReactElement divider :: Array ReactElement
divider = [li [className "divider"] []] divider = [li [className "divider"] []]
-- | surgar for target : "blank" -- | surgar for target : "blank"
data LiNav_ = LiNav_ { title :: String --data LiNav_ = LiNav_ { title :: String
, href :: String -- , href :: String
, icon :: String -- , icon :: String
, text :: String -- , text :: String
, target :: String -- , target :: String
} -- }
data LiNav = LiNav { title :: String data LiNav = LiNav { title :: String
......
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