Commit 83b79870 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Top bar handed now.

parent 7a08abd3
...@@ -169,14 +169,16 @@ topBarCpt = R.hooksComponent "G.C.A.topBar" cpt ...@@ -169,14 +169,16 @@ topBarCpt = R.hooksComponent "G.C.A.topBar" cpt
, className: "navbar navbar-inverse navbar-fixed-top" } , className: "navbar navbar-inverse navbar-fixed-top" }
[ H.div { className: "container-fluid" } [ H.div { className: "container-fluid" }
[ H.div { className: "navbar-inner" } [ H.div { className: "navbar-inner" }
[ logo [ logo (fst handed)
, H.div { className: "collapse navbar-collapse" } , H.div { className: "collapse navbar-collapse" <> navHanded}
[ H.ul { className: "nav navbar-nav" } [divDropdownLeft] $ sortHanded
[ H.ul { className: "nav navbar-nav" <> navHanded} [divDropdownLeft]
, H.ul { title: "If you are Left Handed you can change " , H.ul { title: "If you are Left Handed you can change "
<> "the interface by clicking on me. Click " <> "the interface by clicking on me. Click "
<> "again to come back to previous state." <> "again to come back to previous state."
, className: "nav navbar-nav" , className: "nav navbar-nav" <> navHanded
} [handedChooser { handed }] } [handedChooser { handed }]
, H.ul { className: "nav navbar-nav" <> navHanded} []
{-, H.ul { title: "Dark Mode soon here" {-, H.ul { title: "Dark Mode soon here"
, className : "nav navbar-nav" , className : "nav navbar-nav"
} [ H.li {} [ H.a {} [ H.span {className : "fa fa-moon"}[] } [ H.li {} [ H.a {} [ H.span {className : "fa fa-moon"}[]
...@@ -188,6 +190,9 @@ topBarCpt = R.hooksComponent "G.C.A.topBar" cpt ...@@ -188,6 +190,9 @@ topBarCpt = R.hooksComponent "G.C.A.topBar" cpt
] ]
] ]
] ]
where
navHanded = if fst handed == GT.LeftHanded then " navbar-right" else ""
sortHanded = if fst handed == GT.LeftHanded then reverse else reverse -- identity
-- SB.searchBar {session, databases: allDatabases} -- SB.searchBar {session, databases: allDatabases}
type HandedChooserProps = ( type HandedChooserProps = (
...@@ -215,15 +220,16 @@ handedChooserCpt = R.hooksComponent "G.C.A.handedChooser" cpt ...@@ -215,15 +220,16 @@ handedChooserCpt = R.hooksComponent "G.C.A.handedChooser" cpt
GT.LeftHanded -> GT.RightHanded GT.LeftHanded -> GT.RightHanded
GT.RightHanded -> GT.LeftHanded GT.RightHanded -> GT.LeftHanded
logo :: R.Element logo :: GT.Handed -> R.Element
logo = logo handed =
H.a { className, href: "#/" } H.a { className, href: "#/" }
[ H.img { src, title, width: "30", height: "28" } [ H.img { src, title, width: "30", height: "28" }
] ]
where where
className = "navbar-brand logoSmall" className = "navbar-brand logoSmall" <> navHanded
src = "images/logoSmall.png" src = "images/logoSmall.png"
title = "Back to home." title = "Back to home."
navHanded = if handed == GT.LeftHanded then " navbar-right" else ""
divDropdownLeft :: R.Element divDropdownLeft :: R.Element
divDropdownLeft = divDropdownLeft =
......
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