mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-24 06:02:36 +03:00
Extract view example helper
This commit is contained in:
parent
c0e54f31cc
commit
f75565cb17
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user