Skip to content
Snippets Groups Projects
Commit 57032dfb authored by Aamon Paul Hoffmann's avatar Aamon Paul Hoffmann
Browse files

added spinner to data loading

parent 6515f811
No related branches found
No related tags found
No related merge requests found
Pipeline #24402 failed
......@@ -188,20 +188,32 @@ viewContent : Model -> Html Msg
viewContent ( global, local ) =
let
message =
case global.progress of
Loading ->
"Insert some loading icon here..."
Failure msg ->
msg |> (++) "Error while loading data. "
Success ->
"Data was loaded successfully!"
Html.div
[ Html.Attributes.style "justify-items" "center"
, Html.Attributes.style "align-content" "center"
, Html.Attributes.style "flex-grow" "1"
]
(case global.progress of
Loading ->
[ Html.div [ Html.Attributes.class "loader" ] []
, Html.div
[ Html.Attributes.style "position" "relative"
, Html.Attributes.style "bottom" "5rem"
]
[ Html.text "Loading Data..." ]
]
Failure msg ->
[ Html.text (msg |> (++) "Error while loading data. ") ]
Success ->
[ Html.text "Data was loaded successfully!" ]
)
in
case global.view of
Home ->
div [ Html.Attributes.class "content" ]
[ text message ]
[ message ]
Other ->
div [ Html.Attributes.class "content" ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment