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 ->
case List.head (examples (\m -> m.name == doodad)) of
Just example ->
Html.div
[ css
[ maxWidth (Css.px 1400)
, margin auto
]
]
[ Example.view model.previousRoute
{ packageDependencies = model.elliePackageDependencies }
example
|> Html.map (UpdateModuleStates example.name)
]
viewExample model example
|> Html.map (UpdateModuleStates example.name)
Nothing ->
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 currentRoute content =
Html.div