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

View File

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

View File

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

View File

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

View File

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