Update examples to use List Html for body.

This commit is contained in:
Dillon Kearns 2022-10-05 12:47:48 -07:00
parent 8ff1f21754
commit 0303636813
5 changed files with 13 additions and 11 deletions

View File

@ -1,6 +1,5 @@
module Shared exposing (Data, Model, Msg(..), SharedMsg(..), template)
import Browser.Navigation
import DataSource
import Effect exposing (Effect)
import Html exposing (Html)
@ -90,11 +89,12 @@ view :
-> Model
-> (Msg -> msg)
-> View msg
-> { body : Html msg, title : String }
-> { body : List (Html msg), title : String }
view stars page model toMsg pageView =
{ body =
Html.Styled.div []
[ Html.Styled.div []
pageView.body
|> Html.Styled.toUnstyled
]
, title = pageView.title
}

View File

@ -89,11 +89,12 @@ view :
-> Model
-> (Msg -> msg)
-> View msg
-> { body : Html msg, title : String }
-> { body : List (Html msg), title : String }
view stars page model toMsg pageView =
{ body =
Html.Styled.div []
[ Html.Styled.div []
pageView.body
|> Html.Styled.toUnstyled
]
, title = pageView.title
}

View File

@ -1,6 +1,5 @@
module Shared exposing (Data, Model, Msg(..), SharedMsg(..), template)
import Browser.Navigation
import DataSource
import Effect exposing (Effect)
import Html exposing (Html)
@ -90,11 +89,12 @@ view :
-> Model
-> (Msg -> msg)
-> View msg
-> { body : Html msg, title : String }
-> { body : List (Html msg), title : String }
view stars page model toMsg pageView =
{ body =
Html.Styled.div []
[ Html.Styled.div []
pageView.body
|> Html.Styled.toUnstyled
]
, title = pageView.title
}

View File

@ -96,11 +96,12 @@ view :
-> Model
-> (Msg -> msg)
-> View msg
-> { body : Html msg, title : String }
-> { body : List (Html msg), title : String }
view stars page model toMsg pageView =
{ body =
Html.Styled.div []
[ Html.Styled.div []
pageView.body
|> Html.Styled.toUnstyled
]
, title = pageView.title
}

View File

@ -537,7 +537,7 @@ config apiRoutes pages =
in
case thing of
Just _ ->
{ view = \_ -> { title = "Title", body = Html.text "" }, head = [] }
{ view = \_ -> { title = "Title", body = [ Html.text "" ] }, head = [] }
Nothing ->
Debug.todo <| "Couldn't find page: " ++ Debug.toString page ++ "\npages: " ++ Debug.toString pages