Commit a67cfce8 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[NAVBAR] facto menu title.

parent 6669b263
...@@ -237,18 +237,32 @@ divLogo = a [ className "navbar-brand logoSmall" ...@@ -237,18 +237,32 @@ divLogo = a [ className "navbar-brand logoSmall"
] [] ] []
] ]
divDropdownLeft :: ReactElement divDropdownLeft :: ReactElement
divDropdownLeft = ul [className "nav navbar-nav"] divDropdownLeft = divDropdownLeft' (LiNav { title : "About Gargantext"
, href : "#"
, icon : "glyphicon glyphicon-info-sign"
, text : "Info"
}
)
divDropdownLeft' :: LiNav -> ReactElement
divDropdownLeft' (LiNav { title: title'
, href : href'
, icon : icon'
, text : text'
}
) = ul [className "nav navbar-nav"]
[ ul [className "nav navbar-nav pull-left"] [ ul [className "nav navbar-nav pull-left"]
[ li [className "dropdown"] [ li [className "dropdown"]
[ a [ className "dropdown-toggle navbar-text" [ a [ className "dropdown-toggle navbar-text"
, _data {toggle: "dropdown"} , _data {toggle: "dropdown"}
, href "#", role "button" , href href', role "button"
, title "About Gargantext" , title title'
][ span [ aria {hidden : true} ][ span [ aria {hidden : true}
, className "glyphicon glyphicon-info-sign" , className icon'
] [] ] []
, text " Info" , text (" " <> text')
] ]
, ul [className "dropdown-menu"] divLeftdropdownElements , ul [className "dropdown-menu"] divLeftdropdownElements
] ]
...@@ -258,7 +272,7 @@ divDropdownLeft = ul [className "nav navbar-nav"] ...@@ -258,7 +272,7 @@ divDropdownLeft = ul [className "nav navbar-nav"]
-- | WYSIWYG example in Pure React ? -- | WYSIWYG example in Pure React ?
divLeftdropdownElements :: Array ReactElement divLeftdropdownElements :: Array ReactElement
divLeftdropdownElements = menu divLeftdropdownElements = menu -- 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/"
...@@ -285,7 +299,7 @@ divLeftdropdownElements = menu ...@@ -285,7 +299,7 @@ divLeftdropdownElements = menu
] ]
,------------------------------------------------------------ ,------------------------------------------------------------
[ LiNav { title : "More about us (you)" [ LiNav { title : "More about us (you)"
, href : "http://iscpif.fr" , href : "https://iscpif.fr"
, icon : "fas fa-question-circle" , icon : "fas fa-question-circle"
, text : "About" , text : "About"
} }
...@@ -299,6 +313,14 @@ menu ns = intercalate divider $ map (map liNav) ns ...@@ -299,6 +313,14 @@ menu ns = intercalate divider $ map (map liNav) ns
divider :: Array ReactElement divider :: Array ReactElement
divider = [li [className "divider"] []] divider = [li [className "divider"] []]
-- | surgar for target : "blank"
data LiNav_ = LiNav_ { title :: String
, href :: String
, icon :: String
, text :: String
, target :: String
}
data LiNav = LiNav { title :: String data LiNav = LiNav { title :: String
, href :: String , href :: String
...@@ -307,17 +329,17 @@ data LiNav = LiNav { title :: String ...@@ -307,17 +329,17 @@ data LiNav = LiNav { title :: String
} }
liNav :: LiNav -> ReactElement liNav :: LiNav -> ReactElement
liNav (LiNav { title:tit liNav (LiNav { title : title'
, href :h , href : href'
, icon:i , icon : icon'
, text: txt , text : text'
} }
) = li [] [ a [ tabIndex (-1) ) = li [] [ a [ tabIndex (-1)
, target "blank" , target "blank"
, title tit , title title'
, href h , href href'
] [ span [ className i ] [] ] [ span [ className icon' ] []
, text $ " " <> txt , text $ " " <> text'
] ]
] ]
......
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