Commit 15eed678 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/425-dev-terms-page-reset' into dev

parents 8ec3b623 851ebc93
...@@ -35,7 +35,7 @@ searchInputCpt = here.component "searchInput" cpt ...@@ -35,7 +35,7 @@ searchInputCpt = here.component "searchInput" cpt
pure $ R2.row pure $ R2.row
[ H.div { className: "col-12" } [ H.div { className: "col-12" }
[ H.div { className: "input-group" } [ H.div { className: "input-group" }
[ searchFieldInput { inputRef, searchQuery } [] [ searchFieldInput { inputRef, searchQuery, params } []
, searchButton { inputRef, searchQuery, params } [] , searchButton { inputRef, searchQuery, params } []
] ]
] ]
...@@ -123,14 +123,14 @@ searchButtonCpt = here.component "searchButton" cpt where ...@@ -123,14 +123,14 @@ searchButtonCpt = here.component "searchButton" cpt where
type SearchFieldInputProps = type SearchFieldInputProps =
( inputRef :: R.Ref (Nullable DOM.Element) ( inputRef :: R.Ref (Nullable DOM.Element)
, searchQuery :: T.Box String , searchQuery :: T.Box String
, params :: T.Box Params
) )
searchFieldInput :: R2.Component SearchFieldInputProps searchFieldInput :: R2.Component SearchFieldInputProps
searchFieldInput = R.createElement searchFieldInputCpt searchFieldInput = R.createElement searchFieldInputCpt
searchFieldInputCpt :: R.Component SearchFieldInputProps searchFieldInputCpt :: R.Component SearchFieldInputProps
searchFieldInputCpt = here.component "searchFieldInput" cpt where searchFieldInputCpt = here.component "searchFieldInput" cpt where
cpt { inputRef, searchQuery } _ = do cpt { inputRef, searchQuery, params } _ = do
pure $ H.input { className: "form-control" pure $ H.input { className: "form-control"
-- , defaultValue: searchQuery' -- , defaultValue: searchQuery'
, name: "search" , name: "search"
...@@ -142,7 +142,8 @@ searchFieldInputCpt = here.component "searchFieldInput" cpt where ...@@ -142,7 +142,8 @@ searchFieldInputCpt = here.component "searchFieldInput" cpt where
where where
onKeyPress e = do onKeyPress e = do
char <- R2.keyCode e char <- R2.keyCode e
if char == 13 then if char == 13 then do
T.write_ (R2.getInputValue inputRef) searchQuery _ <- T.write_ (R2.getInputValue inputRef) searchQuery
changePage 1 params
else else
pure unit pure unit
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