Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
84b97575
Commit
84b97575
authored
Mar 21, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FACTO] nav sidebar almost done.
parent
a67cfce8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
26 deletions
+33
-26
Navigation.purs
src/Navigation.purs
+33
-26
No files found.
src/Navigation.purs
View file @
84b97575
...
...
@@ -246,33 +246,37 @@ divDropdownLeft = divDropdownLeft' (LiNav { title : "About Gargantext"
}
)
divDropdownLeft' :: LiNav -> ReactElement
divDropdownLeft' (LiNav { title: title'
, href : href'
, icon : icon'
, text : text'
}
) = ul [className "nav navbar-nav"]
divDropdownLeft' mb = ul [className "nav navbar-nav"]
[ ul [className "nav navbar-nav pull-left"]
[ li [className "dropdown"]
[ a [ className "dropdown-toggle navbar-text"
, _data {toggle: "dropdown"}
, href href', role "button"
, title title'
][ span [ aria {hidden : true}
, className icon'
] []
, text (" " <> text')
]
, ul [className "dropdown-menu"] divLeftdropdownElements
[ menuButton mb
, menuElements'
]
]
]
menuButton :: LiNav -> ReactElement
menuButton (LiNav { title : title'
, href : href'
, icon : icon'
, text : text'
}) = a [ className "dropdown-toggle navbar-text"
, _data {toggle: "dropdown"}
, href href', role "button"
, title title'
][ span [ aria {hidden : true}
, className icon'
] []
, text (" " <> text')
]
-- | WYSIWYG example in Pure React ?
divLeftdropdownElements :: Array
ReactElement
divLeftdropdownElements = menu
-- title, icon, text
menuElements' ::
ReactElement
menuElements' = menuElements
-- title, icon, text
[ -- ===========================================================
[ LiNav { title : "Quick start, tutorials and methodology"
, href : "https://iscpif.fr/gargantext/your-first-map/"
...
...
@@ -307,19 +311,22 @@ divLeftdropdownElements = menu -- title, icon, text
] -- ===========================================================
-- | Menu in the sidebar, syntactic sugar
menu
:: Array (Array LiNav) -> Array
ReactElement
menu
ns =
intercalate divider $ map (map liNav) ns
menu
Elements :: Array (Array LiNav) ->
ReactElement
menu
Elements ns = dropDown $
intercalate divider $ map (map liNav) ns
where
dropDown :: Array ReactElement -> ReactElement
dropDown = ul [className "dropdown-menu"]
divider :: Array ReactElement
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
--
, href :: String
--
, icon :: String
--
, text :: String
--
, target :: String
--
}
data LiNav = LiNav { title :: String
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment