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