elm-pages-v3-beta/examples/pokedex/app/Route/Hex/Hex_.elm

42 lines
756 B
Elm
Raw Normal View History

module Route.Hex.Hex_ exposing (Data, Model, Msg, page)
import ColorHelpers
import DataSource exposing (DataSource)
2022-03-05 20:50:01 +03:00
import RouteBuilder exposing (StatelessRoute, StaticPayload)
type alias Model =
{}
type alias Msg =
()
type alias RouteParams =
{ hex : String }
type alias Data =
ColorHelpers.Data
2022-03-05 20:50:01 +03:00
page : StatelessRoute RouteParams Data
page =
2022-03-05 20:50:01 +03:00
RouteBuilder.preRenderWithFallback
{ head = ColorHelpers.head toCssVal
, pages = pages
, data = ColorHelpers.data
}
2022-03-05 20:50:01 +03:00
|> RouteBuilder.buildNoState { view = ColorHelpers.view toCssVal }
toCssVal : RouteParams -> String
toCssVal routeParams =
"#" ++ routeParams.hex
pages : DataSource (List RouteParams)
pages =
DataSource.succeed []