Simplify silence list view code

This commit is contained in:
stuart nelson 2017-02-21 12:31:27 +01:00
parent b707d5c7f3
commit 215e91da8c
2 changed files with 12 additions and 12 deletions

View File

@ -15,6 +15,17 @@ import Utils.Views exposing (..)
import Utils.Date
silences : List Silence -> Html Msg
silences silences =
ul
[ classList
[ ( "list", True )
, ( "pa0", True )
]
]
(List.map silenceList silences)
silenceList : Silence -> Html Msg
silenceList silence =
li

View File

@ -51,7 +51,7 @@ view model =
-- Add buttons at the top to filter Active/Pending/Expired
case model.silences of
Success silences ->
Html.map silenceTranslator (apiDataList Silences.Views.silenceList silences)
Html.map silenceTranslator (Silences.Views.silences silences)
Loading ->
loading
@ -121,14 +121,3 @@ error err =
[ h1 [] [ text "Error" ]
, p [] [ text msg ]
]
apiDataList : (a -> Html msg) -> List a -> Html msg
apiDataList fn list =
ul
[ classList
[ ( "list", True )
, ( "pa0", True )
]
]
(List.map fn list)