Skip to content

Instantly share code, notes, and snippets.

@ryan-senn
Last active December 4, 2016 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryan-senn/84a42f40244db568c4cd3bd8dbf2a313 to your computer and use it in GitHub Desktop.
Save ryan-senn/84a42f40244db568c4cd3bd8dbf2a313 to your computer and use it in GitHub Desktop.
module Authentication.Login exposing (..)
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Authentication.Msg exposing (Msg)
import Common.LoadingButton exposing (loadingButton)
login : String -> String -> Bool -> Html Authentication.Msg.Msg
login username password isAuthenticating =
div [ class "login" ]
[ div [ class "form-group" ]
[ label [ class "control-label" ] [ text "Username" ]
, input [ onInput Authentication.Msg.UpdateUsername, class "form-control", value username ] []
]
, div [ class "form-group" ]
[ label [ class "control-label" ] [ text "Password" ]
, input [ type_ "password", onInput Authentication.Msg.UpdatePassword, class "form-control", value password ] []
]
, loadingButton "Authenticate" "log-in" isAuthenticating Authentication.Msg.AuthenticateRequest
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment