Extract view example helper

This commit is contained in:
Tessa Kelly 2022-03-30 11:01:16 -07:00
parent c0e54f31cc
commit f75565cb17

View File

@ -187,17 +187,8 @@ view_ model =
Routes.Doodad doodad -> Routes.Doodad doodad ->
case List.head (examples (\m -> m.name == doodad)) of case List.head (examples (\m -> m.name == doodad)) of
Just example -> Just example ->
Html.div viewExample model example
[ css |> Html.map (UpdateModuleStates example.name)
[ maxWidth (Css.px 1400)
, margin auto
]
]
[ Example.view model.previousRoute
{ packageDependencies = model.elliePackageDependencies }
example
|> Html.map (UpdateModuleStates example.name)
]
Nothing -> Nothing ->
Page.notFound Page.notFound
@ -224,6 +215,15 @@ view_ model =
] ]
viewExample : Model -> Example a msg -> Html msg
viewExample model example =
Html.div [ css [ maxWidth (Css.px 1400), margin auto ] ]
[ Example.view model.previousRoute
{ packageDependencies = model.elliePackageDependencies }
example
]
withSideNav : Route -> List (Html Msg) -> Html Msg withSideNav : Route -> List (Html Msg) -> Html Msg
withSideNav currentRoute content = withSideNav currentRoute content =
Html.div Html.div