mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-27 05:44:17 +03:00
24 lines
442 B
Elm
24 lines
442 B
Elm
module View exposing (View, map, placeholder)
|
|
|
|
import Html.Styled as Html exposing (Html)
|
|
|
|
|
|
type alias View msg =
|
|
{ title : String
|
|
, body : List (Html msg)
|
|
}
|
|
|
|
|
|
map : (msg1 -> msg2) -> View msg1 -> View msg2
|
|
map fn view =
|
|
{ title = view.title
|
|
, body = List.map (Html.map fn) view.body
|
|
}
|
|
|
|
|
|
placeholder : String -> View msg
|
|
placeholder moduleName =
|
|
{ title = "Placeholder"
|
|
, body = [ Html.text moduleName ]
|
|
}
|