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
b4f5c82f
Commit
b4f5c82f
authored
Jan 21, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DESIGN] fix buttons
parent
cd608779
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
ToggleButton.purs
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
+11
-6
No files found.
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
View file @
b4f5c82f
...
...
@@ -28,6 +28,7 @@ type Props = (
state :: R.State Boolean
, onMessage :: String
, offMessage :: String
, style :: String
, onClick :: forall e. e -> Effect Unit
)
...
...
@@ -37,10 +38,10 @@ toggleButton props = R.createElement toggleButtonCpt props []
toggleButtonCpt :: R.Component Props
toggleButtonCpt = R.hooksComponentWithModule thisModule "toggleButton" cpt
where
cpt {state, onMessage, offMessage, onClick} _ = do
cpt {state, onMessage, offMessage, onClick
, style
} _ = do
let (toggled /\ _) = state
pure $ H.button { className: "btn btn-outline-
light
" <> cls toggled
pure $ H.button { className: "btn btn-outline-
" <> style <> "
" <> cls toggled
, on: {click: onClick}
} [ R2.small {} [ H.text (text onMessage offMessage toggled) ] ]
...
...
@@ -56,6 +57,7 @@ controlsToggleButton state =
, onMessage: "Hide Controls"
, offMessage: "Show Controls"
, onClick: \_ -> snd state not
, style: "light"
}
type EdgesButtonProps = (
...
...
@@ -69,14 +71,14 @@ edgesToggleButtonCpt :: R.Component EdgesButtonProps
edgesToggleButtonCpt = R.hooksComponentWithModule thisModule "edgesToggleButton" cpt
where
cpt {state: (state /\ setState)} _ = do
pure $ H.button { className: "btn btn-outline-
light
" <> cls state
pure $ H.button { className: "btn btn-outline-
primary
" <> cls state
, on: { click: onClick setState }
} [ R2.small {} [ H.text (text state) ] ]
text s = if SigmaxTypes.edgeStateHidden s then "Show edges" else "Hide edges"
cls SigmaxTypes.EShow = "
active
"
cls _ = ""
cls SigmaxTypes.EShow = ""
cls _ = "
active
"
-- TODO: Move this to Graph.purs to the R.useEffect handler which renders nodes/edges
onClick setState _ = setState SigmaxTypes.toggleShowEdgesState
...
...
@@ -88,6 +90,7 @@ louvainToggleButton state =
, onMessage: "Louvain off"
, offMessage: "Louvain on"
, onClick: \_ -> snd state not
, style: "primary"
}
multiSelectEnabledButton :: R.State Boolean -> R.Element
...
...
@@ -97,6 +100,7 @@ multiSelectEnabledButton state =
, onMessage: "Single-node"
, offMessage: "Multi-node"
, onClick: \_ -> snd state not
, style : "primary"
}
type ForceAtlasProps = (
...
...
@@ -110,7 +114,7 @@ pauseForceAtlasButtonCpt :: R.Component ForceAtlasProps
pauseForceAtlasButtonCpt = R.hooksComponentWithModule thisModule "forceAtlasToggleButton" cpt
where
cpt {state: (state /\ setState)} _ = do
pure $ H.button { className: "btn btn-outline-
light
" <> cls state
pure $ H.button { className: "btn btn-outline-
primary
" <> cls state
, on: { click: onClick setState }
} [ R2.small {} [ H.text (text state) ] ]
...
...
@@ -132,6 +136,7 @@ treeToggleButton state =
, onMessage: "Hide Tree"
, offMessage: "Show Tree"
, onClick: \_ -> snd state not
, style: "light"
}
sidebarToggleButton :: R.State GET.SidePanelState -> R.Element
...
...
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