bf09b87215
* Part 1: Refactor views. I'm in the middle of nowhere. It's cold, but I distinguish lights. It's dark, but my good ol' Elm keeps barking when something looks wrong or dangerous. I'm not afraid. * Part 2: More views refactoring. The night is deep, but I can see clear. The truth is at the end of this path. Perhaps. * Part 3: The sun is rising. The darkness is gently fading over, dawn is near. I can now see mountains drawing in the horizon. Elm is rather quiet, but keeps scrutating the shadows. * Part 4: Moaar view splitting. I follow some wrong path, but I'm back on track. The sun is shining. * Epilogue That was actually fun.
25 lines
474 B
Elm
25 lines
474 B
Elm
module View.Error
|
|
exposing
|
|
( errorView
|
|
, errorsListView
|
|
)
|
|
|
|
import Html exposing (..)
|
|
import Html.Attributes exposing (..)
|
|
import Types exposing (..)
|
|
|
|
|
|
errorView : String -> Html Msg
|
|
errorView error =
|
|
div [ class "alert alert-danger" ] [ text error ]
|
|
|
|
|
|
errorsListView : Model -> Html Msg
|
|
errorsListView model =
|
|
case model.errors of
|
|
[] ->
|
|
text ""
|
|
|
|
errors ->
|
|
div [] <| List.map errorView model.errors
|