Externalize strings for home page

This commit is contained in:
Eike Kettner
2021-04-05 21:31:45 +02:00
parent 9c1beb2240
commit 1762e7afac
24 changed files with 601 additions and 225 deletions

View File

@ -2,6 +2,7 @@ module Comp.PowerSearchInput exposing
( Action(..)
, Model
, Msg
, ViewSettings
, init
, update
, viewInput
@ -133,12 +134,18 @@ throttleUpdate model =
--- View
viewInput : List (Attribute Msg) -> Model -> Html Msg
viewInput attrs model =
type alias ViewSettings =
{ placeholder : String
, extraAttrs : List (Attribute Msg)
}
viewInput : ViewSettings -> Model -> Html Msg
viewInput cfg model =
input
(attrs
(cfg.extraAttrs
++ [ type_ "text"
, placeholder "Search query "
, placeholder cfg.placeholder
, onInput SetSearch
, Util.Html.onKeyUpCode KeyUpMsg
, Maybe.map value model.input