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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
4ff8ccf8
Commit
4ff8ccf8
authored
Dec 18, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ERGO] Handed button does not disappear under mouse pointer after click
parent
6a2d34c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
40 deletions
+47
-40
Public.purs
src/Gargantext/Components/Nodes/Home/Public.purs
+6
-6
TopBar.purs
src/Gargantext/Components/TopBar.purs
+30
-27
Prelude.purs
src/Gargantext/Prelude.purs
+7
-1
Types.purs
src/Gargantext/Types.purs
+4
-6
No files found.
src/Gargantext/Components/Nodes/Home/Public.purs
View file @
4ff8ccf8
...
...
@@ -117,12 +117,12 @@ publicLayoutCpt = R.hooksComponentWithModule thisModule "publicLayout" cpt
[ H.div { className:"container1"
, style: { marginBottom : "15px"}
}
[ H.h2 {} [H.text "Discover knowledge"
, H.p { className: "lead text-muted center"}
[ H.text "maps made with "
, H.span {className: "fa fa-heart"} []
]
]
[ H.h2 {} [
H.text "Discover knowledge"
, H.p { className: "lead text-muted center"}
[ H.text "maps made with "
, H.span {className: "fa fa-heart"} []
]
]
]
]
-- | TODO browse maps
...
...
src/Gargantext/Components/TopBar.purs
View file @
4ff8ccf8
...
...
@@ -6,7 +6,6 @@ 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(..))
...
...
@@ -15,9 +14,7 @@ import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.TopBar"
type TopBarProps = (
handed :: R.State Handed
)
type TopBarProps = (handed :: R.State Handed)
topBar :: R2.Component TopBarProps
topBar = R.createElement topBarCpt
...
...
@@ -31,35 +28,41 @@ topBarCpt = R.hooksComponentWithModule thisModule "topBar" cpt
, className: "navbar navbar-inverse navbar-fixed-top" }
[ H.div { className: "container-fluid" }
[ H.div { className: "navbar-inner" }
[ logo
(fst handed)
, H.div { className: "collapse navbar-collapse" <> navHanded} (
[
H.ul { className: "nav navbar-nav" <> navHanded
} []
, H.ul { title: "If you are Left Handed you can change "
<> "the interface by clicking on me. Click "
<> "again to come back to previous state.
"
, className: "nav navbar-nav" <> navHanded
} [handedChooser { handed } []
]
, H.ul { className: "nav navbar-nav" <> navHanded} [divDropdownLeft {} []
]
{-, H.ul { title: "Dark Mode soon here"
, className : "nav navbar-nav"
} [ H.li {} [ H.a {} [ H.span {className : "fa fa-moon"}[]
]
]
]
-
}
] <> children)
]
[ 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
]
]
]
where
navHanded = if fst handed == LeftHanded then " navbar-right" else ""
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 "
<> "again to come back to previous state."
, className: "nav navbar-nav" <> navHanded t
} [handedChooser { handed } []]
-- sortHanded = if fst handed == LeftHanded then reverse else reverse -- identity
-- SB.searchBar {session, databases: allDatabases}
logo :: Handed -> R.Element
logo handed =
logo ::
Boolean ->
Handed -> R.Element
logo
b
handed =
H.a { className, href: "#/" }
[ H.img { src, title, width: "30", height: "28" }
]
...
...
@@ -67,7 +70,7 @@ logo handed =
className = "navbar-brand logoSmall" <> navHanded
src = "images/logoSmall.png"
title = "Back to home."
navHanded = if
handed == LeftHanded
then " navbar-right" else ""
navHanded = if
xor b (handed == LeftHanded)
then " navbar-right" else ""
divDropdownLeft :: R2.Component ()
...
...
src/Gargantext/Prelude.purs
View file @
4ff8ccf8
module Gargantext.Prelude (module Prelude, logs, logExceptions, id, class Read, read)
module Gargantext.Prelude (module Prelude, logs, logExceptions, id, class Read, read
, xor
)
where
import Data.Maybe (Maybe)
...
...
@@ -35,3 +35,9 @@ logExceptions message f x =
logs e
throwException e) do
pure $ f x
xor :: Boolean -> Boolean -> Boolean
xor true false = true
xor false true = true
xor _ _ = false
src/Gargantext/Types.purs
View file @
4ff8ccf8
...
...
@@ -10,23 +10,21 @@ import Data.Generic.Rep.Ord (genericCompare)
import Data.Generic.Rep.Show (genericShow)
import Data.Int (toNumber)
import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Data.Tuple (fst, snd)
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Gargantext.Prelude
import Prim.Row (class Union)
import Reactix as R
import URI.Query (Query)
import Gargantext.Prelude
-------------------------------------------------------------------------
data Handed = LeftHanded | RightHanded
derive instance genericHanded :: Generic Handed _
instance eqHanded :: Eq Handed where
eq = genericEq
reverseHanded :: Handed -> Handed
reverseHanded LeftHanded = RightHanded
reverseHanded RightHanded = LeftHanded
-------------------------------------------------------------------------
type ID = Int
type Name = 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