mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 14:34:18 +03:00
24 lines
462 B
Elm
24 lines
462 B
Elm
module View exposing (View, map, placeholder)
|
|
|
|
import Html.Styled exposing (text)
|
|
|
|
|
|
type alias View msg =
|
|
{ title : String
|
|
, body : List (Html.Styled.Html msg)
|
|
}
|
|
|
|
|
|
map : (msg1 -> msg2) -> View msg1 -> View msg2
|
|
map fn doc =
|
|
{ title = doc.title
|
|
, body = List.map (Html.Styled.map fn) doc.body
|
|
}
|
|
|
|
|
|
placeholder : String -> View msg
|
|
placeholder moduleName =
|
|
{ title = "Placeholder - " ++ moduleName
|
|
, body = [ text moduleName ]
|
|
}
|