Commit b8122ab3 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Icon + placeHolder

parent b1f181e8
...@@ -88,7 +88,7 @@ shareNodeInnerCpt :: R.Component ShareNodeInner ...@@ -88,7 +88,7 @@ shareNodeInnerCpt :: R.Component ShareNodeInner
shareNodeInnerCpt = here.component "shareNodeInner" cpt shareNodeInnerCpt = here.component "shareNodeInner" cpt
where where
cpt { dispatch, completions } _ = do cpt { dispatch, completions } _ = do
state <- T.useBox "username" state <- T.useBox ""
text' /\ text <- R2.useBox' "" text' /\ text <- R2.useBox' ""
pure $ Tools.panel pure $ Tools.panel
...@@ -98,7 +98,8 @@ shareNodeInnerCpt = here.component "shareNodeInner" cpt ...@@ -98,7 +98,8 @@ shareNodeInnerCpt = here.component "shareNodeInner" cpt
, classes: "d-flex align-items-center" , classes: "d-flex align-items-center"
, autocompleteSearch , autocompleteSearch
, onAutocompleteClick , onAutocompleteClick
, text } , text
, placeHolder: "username or email"}
] (H.div {} [H.text text']) ] (H.div {} [H.text text'])
where where
autocompleteSearch input = nub $ filter (contains (Pattern input)) completions autocompleteSearch input = nub $ filter (contains (Pattern input)) completions
......
...@@ -135,6 +135,7 @@ type Props' = ...@@ -135,6 +135,7 @@ type Props' =
, boxAction :: String -> Action , boxAction :: String -> Action
, state :: T.Box String , state :: T.Box String
, text :: T.Box String , text :: T.Box String
, placeHolder :: String
) )
inputWithAutocomplete' :: R2.Leaf Props' inputWithAutocomplete' :: R2.Leaf Props'
...@@ -148,7 +149,8 @@ inputWithAutocompleteCpt' = here.component "inputWithAutocomplete" cpt ...@@ -148,7 +149,8 @@ inputWithAutocompleteCpt' = here.component "inputWithAutocomplete" cpt
, dispatch , dispatch
, boxAction , boxAction
, state , state
, text } _ = do , text
, placeHolder } _ = do
-- States -- States
state' <- T.useLive T.unequal state state' <- T.useLive T.unequal state
containerRef <- R.useRef null containerRef <- R.useRef null
...@@ -168,6 +170,7 @@ inputWithAutocompleteCpt' = here.component "inputWithAutocomplete" cpt ...@@ -168,6 +170,7 @@ inputWithAutocompleteCpt' = here.component "inputWithAutocomplete" cpt
, ref: inputRef , ref: inputRef
, className: "form-control" , className: "form-control"
, value: state' , value: state'
, placeHolder: placeHolder
, on: { focus: onFocus completions state' , on: { focus: onFocus completions state'
, input: onInput completions , input: onInput completions
, change: onInput completions , change: onInput completions
...@@ -178,7 +181,7 @@ inputWithAutocompleteCpt' = here.component "inputWithAutocomplete" cpt ...@@ -178,7 +181,7 @@ inputWithAutocompleteCpt' = here.component "inputWithAutocomplete" cpt
, B.iconButton , B.iconButton
{ callback: submit state' { callback: submit state'
, title: "Submit" , title: "Submit"
, name: "plus" , name: "send"
, elevation: Level1 , elevation: Level1
} }
] ]
......
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