@@ -12,6 +12,7 @@ module Pages.Navigation exposing
1212import Html exposing (..)
1313import Html.Attributes as Attr
1414import Html.Events as Ev
15+import Html.Lazy as Lazy
1516import List.Nonempty as Nonempty exposing (Nonempty)
1617import Utils exposing (..)
1718
@@ -27,36 +28,38 @@ type alias Config msg =
2728 }
2829
2930
30−navigation : Config msg -> List (Html msg)
31+navigation : Config msg -> Html msg
3132navigation { topButton, title } =
32− (case topButton of
33− Just (MenuButton cfg) ->
34− [ menu cfg ]
35−
36− _ ->
37− []
38− )
39− ++ [ nav [ Attr.class "p-tabs p-tabs__list" ]
40− [ h3 [ Attr.class "" ]
41− [ case topButton of
42− Nothing ->
43− button
44− [ Attr.class "p-button--base is-inline u-no-margin", Attr.style "visibility" "hidden" ]
45− []
46−
47− Just (BackButton msg) ->
48− button
49− [ Attr.class "p-button--base is-inline u-no-margin", Ev.onClick msg ]
50− [ i [ Attr.class "p-icon--chevron-up ninety-counter" ] [] ]
51−
52− Just (MenuButton cfg) ->
53− button
54− [ Attr.class "p-button--base is-inline u-no-margin", Ev.onClick cfg.toggle ]
55− [ i [ Attr.class "p-icon--menu" ] [] ]
56− , text title
33+ div []
34+ ((case topButton of
35+ Just (MenuButton cfg) ->
36+ [ Lazy.lazy menu cfg ]
37+
38+ _ ->
39+ []
40+ )
41+ ++ [ nav [ Attr.class "p-tabs p-tabs__list" ]
42+ [ h3 []
43+ [ case topButton of
44+ Nothing ->
45+ button
46+ [ Attr.class "p-button--base is-inline u-no-margin", Attr.style "visibility" "hidden" ]
47+ []
48+
49+ Just (BackButton msg) ->
50+ button
51+ [ Attr.class "p-button--base is-inline u-no-margin", Ev.onClick msg ]
52+ [ i [ Attr.class "p-icon--chevron-up ninety-counter" ] [] ]
53+
54+ Just (MenuButton cfg) ->
55+ button
56+ [ Attr.class "p-button--base is-inline u-no-margin", Ev.onClick cfg.toggle ]
57+ [ i [ Attr.class "p-icon--menu" ] [] ]
58+ , text title
59+ ]
5760 ]
58− ]
59− ]
61+ ]
62+ )
6063
6164
6265type alias MenuConfig msg =
@@ -144,9 +147,9 @@ showNavigationView stack render =
144147 render (Nonempty.head stack)
145148 in
146149 div []
147− (navigation
150+ [ Lazy.lazy navigation
148151 { topButton = topButton
149152 , title = title
150153 }
151− ++ [ main_ [] body ]
152− )
154+ , main_ [] body
155+ ]