@@ -12,6 +12,7 @@ module Pages.Navigation exposing
12import Html exposing (..)
12import Html exposing (..)
13import Html.Attributes as Attr
13import Html.Attributes as Attr
14import Html.Events as Ev
14import Html.Events as Ev
15+import Html.Lazy as Lazy
15import List.Nonempty as Nonempty exposing (Nonempty)
16import List.Nonempty as Nonempty exposing (Nonempty)
16import Utils exposing (..)
17import Utils exposing (..)
@@ -27,36 +28,38 @@ type alias Config msg =
30−navigation : Config msg -> List (Html msg)
31+navigation : Config msg -> Html msg
31navigation { topButton, title } =
32navigation { topButton, title } =
32− (case topButton of
34+ ((case topButton of
33− Just (MenuButton cfg) ->
35+ Just (MenuButton cfg) ->
34− [ menu cfg ]
36+ [ Lazy.lazy menu cfg ]
39− ++ [ nav [ Attr.class "p-tabs p-tabs__list" ]
41+ ++ [ nav [ Attr.class "p-tabs p-tabs__list" ]
40− [ h3 [ Attr.class "" ]
42+ [ h3 []
41− [ case topButton of
43+ [ case topButton of
42− Nothing ->
44+ Nothing ->
44− [ Attr.class "p-button--base is-inline u-no-margin", Attr.style "visibility" "hidden" ]
46+ [ Attr.class "p-button--base is-inline u-no-margin", Attr.style "visibility" "hidden" ]
47− Just (BackButton msg) ->
49+ Just (BackButton msg) ->
49− [ Attr.class "p-button--base is-inline u-no-margin", Ev.onClick msg ]
51+ [ Attr.class "p-button--base is-inline u-no-margin", Ev.onClick msg ]
50− [ i [ Attr.class "p-icon--chevron-up ninety-counter" ] [] ]
52+ [ i [ Attr.class "p-icon--chevron-up ninety-counter" ] [] ]
52− Just (MenuButton cfg) ->
54+ Just (MenuButton cfg) ->
54− [ Attr.class "p-button--base is-inline u-no-margin", Ev.onClick cfg.toggle ]
56+ [ Attr.class "p-button--base is-inline u-no-margin", Ev.onClick cfg.toggle ]
55− [ i [ Attr.class "p-icon--menu" ] [] ]
57+ [ i [ Attr.class "p-icon--menu" ] [] ]
56− , text title
58+ , text title
62type alias MenuConfig msg =
65type alias MenuConfig msg =
@@ -144,9 +147,9 @@ showNavigationView stack render =
144 render (Nonempty.head stack)
147 render (Nonempty.head stack)
147− (navigation
150+ [ Lazy.lazy navigation
148 { topButton = topButton
151 { topButton = topButton
149 , title = title
152 , title = title
151− ++ [ main_ [] body ]
154+ , main_ [] body