diff options
author | Joris | 2016-06-03 20:27:16 +0200 |
---|---|---|
committer | Joris | 2016-06-03 20:27:16 +0200 |
commit | 8e3a7bf1cb83bbb6e3dcd54308eefa52a29cd679 (patch) | |
tree | d6ba0985a534a0e2e317b1edb0d4c999119d87ff /src/client/elm/SignIn | |
parent | 3a88115d118f8256f3ff034dc359df42a9e4051c (diff) |
Migrate to elm 0.17
Diffstat (limited to 'src/client/elm/SignIn')
-rw-r--r-- | src/client/elm/SignIn/Model.elm | 4 | ||||
-rw-r--r-- | src/client/elm/SignIn/Msg.elm (renamed from src/client/elm/SignIn/Action.elm) | 8 | ||||
-rw-r--r-- | src/client/elm/SignIn/Update.elm | 8 | ||||
-rw-r--r-- | src/client/elm/SignIn/View.elm | 19 |
4 files changed, 19 insertions, 20 deletions
diff --git a/src/client/elm/SignIn/Model.elm b/src/client/elm/SignIn/Model.elm index e01de12..19d4305 100644 --- a/src/client/elm/SignIn/Model.elm +++ b/src/client/elm/SignIn/Model.elm @@ -1,7 +1,7 @@ -module SignIn.Model +module SignIn.Model exposing ( Model , init - ) where + ) type alias Model = { login : String diff --git a/src/client/elm/SignIn/Action.elm b/src/client/elm/SignIn/Msg.elm index 1f93f4e..f753ebd 100644 --- a/src/client/elm/SignIn/Action.elm +++ b/src/client/elm/SignIn/Msg.elm @@ -1,8 +1,8 @@ -module SignIn.Action - ( Action(..) - ) where +module SignIn.Msg exposing + ( Msg(..) + ) -type Action = +type Msg = UpdateLogin String | WaitingServer | ValidLogin diff --git a/src/client/elm/SignIn/Update.elm b/src/client/elm/SignIn/Update.elm index f4152a6..28307e4 100644 --- a/src/client/elm/SignIn/Update.elm +++ b/src/client/elm/SignIn/Update.elm @@ -1,13 +1,13 @@ -module SignIn.Update +module SignIn.Update exposing ( update - ) where + ) import SignIn.Model exposing (..) -import SignIn.Action exposing (..) +import SignIn.Msg exposing (..) import Model.Translations exposing (getMessage, Translations) -update : Translations -> Action -> Model -> Model +update : Translations -> Msg -> Model -> Model update translations action signInView = case action of UpdateLogin login -> diff --git a/src/client/elm/SignIn/View.elm b/src/client/elm/SignIn/View.elm index d81d63a..2cec586 100644 --- a/src/client/elm/SignIn/View.elm +++ b/src/client/elm/SignIn/View.elm @@ -1,34 +1,33 @@ -module SignIn.View +module SignIn.View exposing ( view - ) where + ) import Html as H exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) -import Signal exposing (Address) import Json.Decode as Json -import SignIn.Action as SignInAction +import SignIn.Msg as SignInMsg import SignIn.Model as SignInModel import Update exposing (..) import Model exposing (Model) -import Action exposing (..) +import Msg exposing (..) import Model.Translations exposing (getMessage) import View.Events exposing (onSubmitPrevDefault) import View.Icon exposing (renderSpinIcon) -view : Address Action -> Model -> SignInModel.Model -> Html -view address model signInModel = +view : Model -> SignInModel.Model -> Html Msg +view model signInModel = div [ class "signIn" ] [ H.form - [ onSubmitPrevDefault address (SignIn signInModel.login) ] + [ onSubmitPrevDefault (SignIn signInModel.login) ] [ input [ value signInModel.login - , on "input" targetValue (Signal.message address << UpdateSignIn << SignInAction.UpdateLogin) + , on "input" (targetValue |> (Json.map <| (UpdateSignIn << SignInMsg.UpdateLogin))) , name "email" ] [] @@ -44,7 +43,7 @@ view address model signInModel = [ signInResult model signInModel ] ] -signInResult : Model -> SignInModel.Model -> Html +signInResult : Model -> SignInModel.Model -> Html Msg signInResult model signInModel = case signInModel.result of Just result -> |