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
e30994ec
Commit
e30994ec
authored
Dec 04, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] remove button
parent
36ba9be3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
15 deletions
+27
-15
Components.purs
src/Gargantext/Components/NgramsTable/Components.purs
+27
-15
No files found.
src/Gargantext/Components/NgramsTable/Components.purs
View file @
e30994ec
...
...
@@ -32,8 +32,7 @@ thisModule = "Gargantext.Components.NgramsTable.Components"
type SearchInputProps =
(
key :: String -- to prevent refreshing & losing input
( key :: String -- to prevent refreshing & losing input
, onSearch :: String -> Effect Unit
, searchQuery :: String
)
...
...
@@ -44,19 +43,32 @@ searchInput props = R.createElement searchInputCpt props []
searchInputCpt :: R.Component SearchInputProps
searchInputCpt = R.hooksComponentWithModule thisModule "searchInput" cpt
where
cpt { onSearch, searchQuery } _ = do
pure $ H.div { className: "input-group" } [
H.div { className: "input-group-addon" } [
H.span { className: "fa fa-search" } []
]
, H.input { className: "form-control"
, defaultValue: searchQuery
, name: "search"
, on: { input: onSearch <<< R.unsafeEventValue }
, placeholder: "Search"
, type: "value" }
]
cpt { onSearch, searchQuery } _ =
pure $ H.div { className: "input-group" }
[ searchButton
, fieldInput searchQuery
]
where
searchButton =
H.div { className: "input-group-addon" }
[
if searchQuery /= ""
then removeButton
else H.span { className: "fa fa-search" } []
]
removeButton =
H.button { className: "btn btn-danger"
, on: {click: \e -> onSearch ""}}
[ H.span {className: "fa fa-times"} []]
fieldInput =
H.input { className: "form-control"
, defaultValue: searchQuery
, name: "search"
, on: { input: onSearch <<< R.unsafeEventValue }
, placeholder: "Search"
, type: "value"
}
type SelectionCheckboxProps =
(
...
...
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