aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/Signup.elm
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/Signup.elm')
-rw-r--r--frontend/src/Signup.elm49
1 files changed, 37 insertions, 12 deletions
diff --git a/frontend/src/Signup.elm b/frontend/src/Signup.elm
index 30794e7..028af9c 100644
--- a/frontend/src/Signup.elm
+++ b/frontend/src/Signup.elm
@@ -2,11 +2,14 @@ module Signup exposing (..)
2 2
3import Browser 3import Browser
4import Browser.Navigation as Nav 4import Browser.Navigation as Nav
5import Html exposing (..) 5import Css exposing (..)
6import Html.Attributes exposing (..) 6import Html
7import Html.Events exposing (..) 7import Html.Styled exposing (..)
8import Html.Styled.Attributes exposing (..)
9import Html.Styled.Events exposing (..)
8import Http 10import Http
9import Json.Encode as Encode 11import Json.Encode as Encode
12import Styles exposing (..)
10import Url 13import Url
11import Url.Parser as P exposing ((</>), Parser, int, oneOf, s, string) 14import Url.Parser as P exposing ((</>), Parser, int, oneOf, s, string)
12 15
@@ -178,19 +181,41 @@ viewStatus s =
178 181
179viewInput : String -> String -> String -> (String -> msg) -> Html msg 182viewInput : String -> String -> String -> (String -> msg) -> Html msg
180viewInput t p v toMsg = 183viewInput t p v toMsg =
181 input [ type_ t, placeholder p, value v, onInput toMsg ] [] 184 loginInputField [ type_ t, placeholder p, value v, onInput toMsg ] []
185
186
187fieldPadding =
188 css
189 [ paddingTop (px 10)
190 , paddingBottom (px 10)
191 ]
182 192
183 193
184view : Model -> Html Msg 194view : Model -> Html Msg
185view model = 195view model =
186 div [] 196 div
187 [ div [] [ viewInput "text" "Enter Username" model.username UserEntered ] 197 [ css
188 , div [] [ viewInput "password" "Password" model.password PassEntered ] 198 [ margin auto
189 , div [] [ viewInput "text" "Email" model.emailId EmailEntered ] 199 , marginTop (pct 10)
190 , div [] [ viewInput "text" "Enter your Phone number" model.phoneNumber PhoneEntered ] 200 , padding (px 20)
191 , div [] [ viewInput "text" "Enter Shipping address" (Maybe.withDefault "" model.address) AddressEntered ] 201 , Css.width (pct 30)
192 , div [] [ button [ onClick CreatePressed ] [ text "Create" ] ] 202 ]
193 , div [] 203 ]
204 [ div [ fieldPadding, css [ bigHeading ] ] [ text "Signup" ]
205 , div [ fieldPadding ] [ viewInput "text" "Username" model.username UserEntered ]
206 , div [ fieldPadding ] [ viewInput "password" "Password" model.password PassEntered ]
207 , div [ fieldPadding ] [ viewInput "text" "Email" model.emailId EmailEntered ]
208 , div [ fieldPadding ] [ viewInput "text" "Phone Number" model.phoneNumber PhoneEntered ]
209 , div [ fieldPadding ] [ viewInput "text" "Shipping Address" (Maybe.withDefault "" model.address) AddressEntered ]
210 , div
211 [ fieldPadding
212 , css [ textAlign center ]
213 ]
214 [ furbyButton
215 [ onClick CreatePressed ]
216 [ text "Create Account" ]
217 ]
218 , div [ fieldPadding ]
194 [ text "Already have a account? " 219 [ text "Already have a account? "
195 , a [ href "/login" ] [ text "Login >" ] 220 , a [ href "/login" ] [ text "Login >" ]
196 ] 221 ]