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
98ee4fae
Commit
98ee4fae
authored
Dec 18, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DOC] Handed feature helper.
parent
4ff8ccf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
29 deletions
+37
-29
TopBar.purs
src/Gargantext/Components/TopBar.purs
+37
-29
No files found.
src/Gargantext/Components/TopBar.purs
View file @
98ee4fae
...
...
@@ -4,12 +4,11 @@ import Data.Array (reverse)
import Data.Foldable (intercalate)
import Data.Tuple (fst)
import Data.Tuple.Nested ((/\))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Types (Handed(..))
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
thisModule :: String
thisModule = "Gargantext.Components.TopBar"
...
...
@@ -25,38 +24,47 @@ topBarCpt = R.hooksComponentWithModule thisModule "topBar" cpt
cpt { handed } children = do
pure $ H.div { id: "dafixedtop"
, role: "navigation"
, className: "navbar navbar-inverse navbar-fixed-top" }
[ H.div { className: "container-fluid" }
[ H.div { className: "navbar-inner" }
[ logo false (fst handed)
, H.div { className: "collapse navbar-collapse" <> navHanded false}
( [
H.ul { className: "nav navbar-nav" <> navHanded false} []
, handButton false handed
, H.ul { className: "nav navbar-nav" <> navHanded false} [divDropdownLeft {} []]
{-, H.ul { title: "Dark Mode soon here"
, className : "nav navbar-nav"
} [ H.li {} [ H.a {} [ H.span {className : "fa fa-moon"}[]
]
]
]
-}
] <> children
)
]
, H.div { className: "navbar-inner" }
[ handButton true handed
]
]
]
, className: "navbar navbar-inverse navbar-fixed-top"
}
[ H.div { className: "container-fluid" }
[ H.div { className: "navbar-inner" } [ logo false (fst handed)]
, infoMenu
, H.div { className: "navbar-inner" } [ handButton true handed ]
, H.div { className: "navbar-inner" } [ smiley true ]
]
]
where
navHanded t = if xor t (fst handed == LeftHanded) then " navbar-right" else " navbar-left"
handButton t handed = H.ul { title: "If you are Left Handed you can change "
<> "the interface by clicking on me. Click "
handButton t handed = H.ul { title: "If you are Left Handed you can change\n"
<> "the interface by clicking on me. Click\n"
<> "again to come back to previous state."
, className: "nav navbar-nav" <> navHanded t
} [handedChooser { handed } []]
smiley t = H.ul { title: "Hello! Looking for the tree ?\n"
<> "Just watch on the other side!\n"
<> "Click on the hand again to see it back."
, className : "nav navbar-nav" <> navHanded t
}
[H.li {} [ H.a {} [H.span {className: "fa fa-question-circle-o"} [] ]]
]
infoMenu = H.div { className: "collapse navbar-collapse" <> navHanded false}
( [
H.ul { className: "nav navbar-nav" <> navHanded false} []
, H.ul { className: "nav navbar-nav" <> navHanded false} [divDropdownLeft {} []]
, handButton false handed
{-, H.ul { title: "Dark Mode soon here"
, className : "nav navbar-nav"
} [ H.li {} [ H.a {} [ H.span {className : "fa fa-moon"}[]
]
]
]
-}
] <> children
)
-- sortHanded = if fst handed == LeftHanded then reverse else reverse -- identity
-- SB.searchBar {session, databases: allDatabases}
...
...
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