diff options
Diffstat (limited to 'frontend/src/Signup.elm')
-rw-r--r-- | frontend/src/Signup.elm | 49 |
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 | ||
3 | import Browser | 3 | import Browser |
4 | import Browser.Navigation as Nav | 4 | import Browser.Navigation as Nav |
5 | import Html exposing (..) | 5 | import Css exposing (..) |
6 | import Html.Attributes exposing (..) | 6 | import Html |
7 | import Html.Events exposing (..) | 7 | import Html.Styled exposing (..) |
8 | import Html.Styled.Attributes exposing (..) | ||
9 | import Html.Styled.Events exposing (..) | ||
8 | import Http | 10 | import Http |
9 | import Json.Encode as Encode | 11 | import Json.Encode as Encode |
12 | import Styles exposing (..) | ||
10 | import Url | 13 | import Url |
11 | import Url.Parser as P exposing ((</>), Parser, int, oneOf, s, string) | 14 | import Url.Parser as P exposing ((</>), Parser, int, oneOf, s, string) |
12 | 15 | ||
@@ -178,19 +181,41 @@ viewStatus s = | |||
178 | 181 | ||
179 | viewInput : String -> String -> String -> (String -> msg) -> Html msg | 182 | viewInput : String -> String -> String -> (String -> msg) -> Html msg |
180 | viewInput t p v toMsg = | 183 | viewInput 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 | |||
187 | fieldPadding = | ||
188 | css | ||
189 | [ paddingTop (px 10) | ||
190 | , paddingBottom (px 10) | ||
191 | ] | ||
182 | 192 | ||
183 | 193 | ||
184 | view : Model -> Html Msg | 194 | view : Model -> Html Msg |
185 | view model = | 195 | view 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 | ] |