diff options
author | William Carroll <wpcarro@gmail.com> | 2020-08-01T22·04+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-08-01T22·04+0100 |
commit | 249e3113ffbcda047bd9461f01aaa64aa2dd94f1 (patch) | |
tree | 6f3edd19086b88a60e48fa66a74cbc501e776b35 /client/src/Login.elm | |
parent | 54eb29eae0398dd19f5fdaed278f29453b0b7e44 (diff) |
Support creating Trips from the frontend
*sigh* ... spent way too much time encoding/decoding date types... I need my database, server, client, and JSON need to agree on types. TL;DR: - Add CSS for elm/datepicker library - Create Common.allErrors to display UI errors - Prefer Data.Time.Calendar.Day instead of newtype Date wrapper around Text
Diffstat (limited to 'client/src/Login.elm')
-rw-r--r-- | client/src/Login.elm | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/client/src/Login.elm b/client/src/Login.elm index 60a45e7fca77..083c4705609d 100644 --- a/client/src/Login.elm +++ b/client/src/Login.elm @@ -1,5 +1,6 @@ module Login exposing (render) +import Common import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) @@ -137,24 +138,7 @@ login model = ] [ UI.header 3 "Welcome to Trip Planner" , loginForm model - , case model.loginError of - Nothing -> - text "" - - Just e -> - UI.errorBanner - { title = "Error logging in" - , body = Utils.explainHttpError e - } - , case model.signUpError of - Nothing -> - text "" - - Just e -> - UI.errorBanner - { title = "Error creating account" - , body = Utils.explainHttpError e - } + , Common.allErrors model ] @@ -174,15 +158,7 @@ logout model = { label = "Logout" , handleClick = State.AttemptLogout } - , case model.logoutError of - Nothing -> - text "" - - Just e -> - UI.errorBanner - { title = "Error logging out" - , body = Utils.explainHttpError e - } + , Common.allErrors model ] |