Commit 2d7e3260 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

SearchField bootstrap styling

parent 0eb05e96
...@@ -58,14 +58,15 @@ searchFieldComponent = R.memo (R.hooksComponent "SearchField" cpt) hasChanged ...@@ -58,14 +58,15 @@ searchFieldComponent = R.memo (R.hooksComponent "SearchField" cpt) hasChanged
databaseInput :: R.State (Maybe Database) -> Array Database -> R.Element databaseInput :: R.State (Maybe Database) -> Array Database -> R.Element
databaseInput (db /\ setDB) dbs = databaseInput (db /\ setDB) dbs =
div {} [ select { className: "database", onChange } (item <$> dbs) ] div { className: "form-group" } [ select { className: "database form-control", onChange } (item <$> dbs) ]
where where
onChange = mkEffectFn1 $ \e -> setDB (readDatabase (e .. "target" .. "value")) onChange = mkEffectFn1 $ \e -> setDB (readDatabase (e .. "target" .. "value"))
item db = option { value: (show db) } [ text (show db) ] item db = option { value: (show db) } [ text (show db) ]
searchInput :: R.State String -> R.Element searchInput :: R.State String -> R.Element
searchInput (term /\ setTerm) = searchInput (term /\ setTerm) =
div {} [ input { defaultValue: term div { className: "form-group" } [ input { defaultValue: term
, className: "form-control"
, type: "text" , type: "text"
, style: { maxWidth: "110px" } , style: { maxWidth: "110px" }
, onChange , onChange
...@@ -75,7 +76,7 @@ searchInput (term /\ setTerm) = ...@@ -75,7 +76,7 @@ searchInput (term /\ setTerm) =
submitButton :: R.State (Maybe Database) -> R.State String -> R.State (Maybe Search) -> R.Element submitButton :: R.State (Maybe Database) -> R.State String -> R.State (Maybe Search) -> R.Element
submitButton (database /\ _) (term /\ _) (_ /\ setSearch) = submitButton (database /\ _) (term /\ _) (_ /\ setSearch) =
div {} [ button { onClick: click } [ text "Search" ] ] div { className: "form-group" } [ button { className: "form-control", onClick: click } [ text "Search" ] ]
where where
click = mkEffectFn1 $ \_ -> do click = mkEffectFn1 $ \_ -> do
case term of case term of
......
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