mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-11-29 23:47:29 +03:00
36 lines
792 B
Elm
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
|
|
]
|