elm-optimize-level-2/testcases/elm-css-realworld/View.elm
2021-09-17 09:34:20 +02:00

36 lines
792 B
Elm

module View exposing (Msg, main, view)
import Button
import Html exposing (Html)
import Html.Styled
import TextInput
type Msg
= ChangeFromText String
| ChangeToText String
| Search
main : Html Msg
main =
Html.Styled.toUnstyled view
view : Html.Styled.Html Msg
view =
Html.Styled.div
[]
[ TextInput.init "From" "Oslo S"
|> TextInput.withInputType TextInput.TextInput
|> TextInput.onChange ChangeFromText
|> TextInput.toHtml
, TextInput.init "To" "Oslo Airport"
|> TextInput.withInputType TextInput.TextInput
|> TextInput.onChange ChangeToText
|> TextInput.toHtml
, Button.init "Search"
|> Button.onClick Search
|> Button.toHtml
]