@@ -11,18 +11,24 @@ const { Title } = Typography;
11
11
12
12
const SignupScheme = Yup . object ( {
13
13
email : Yup . string ( ) . email ( ) . required ( 'Email required' ) ,
14
+ password : Yup . string ( ) . required ( 'Password required' ) ,
15
+ firstName : Yup . string ( ) . required ( 'Firstname required' ) ,
16
+ lastName : Yup . string ( ) . required ( 'Lastname required' ) ,
14
17
} ) ;
15
18
16
19
export function Signup ( ) {
17
20
const history = useHistory ( ) ;
18
21
19
22
const initialValues = {
20
- email : 'emailq' ,
23
+ email : 'emailq@sdl.com' ,
24
+ password : 'password' ,
25
+ firstName : 'firstName' ,
26
+ lastName : 'lastName' ,
21
27
} ;
22
28
23
29
function handleSignup ( values , { setErrors, setSubmitting } ) {
24
30
const CREDENTIALS = {
25
- url : `auth /users/reset-password ` ,
31
+ url : `/users` ,
26
32
method : 'post' ,
27
33
data : values ,
28
34
setErrors,
@@ -38,9 +44,7 @@ export function Signup() {
38
44
}
39
45
40
46
function showSuccessMessage ( ) {
41
- message . success (
42
- `Temporary password has been sent to your registered email. Redirecting to login...`
43
- ) ;
47
+ message . success ( `Signup done. Redirecting to login...` ) ;
44
48
redirectToLogin ( ) ;
45
49
}
46
50
@@ -58,7 +62,7 @@ export function Signup() {
58
62
Signup
59
63
</ Title >
60
64
< p className = "center" style = { { marginBottom : '30px' } } >
61
- Enter your email below.
65
+ Enter your details below.
62
66
</ p >
63
67
64
68
< Formik
@@ -83,6 +87,51 @@ export function Signup() {
83
87
</ Col >
84
88
</ Row >
85
89
90
+ < Row gutter = { 8 } >
91
+ < Col span = { 24 } >
92
+ < Form . Item
93
+ name = "password"
94
+ hasFeedback = { true }
95
+ showValidateSuccess = { true }
96
+ >
97
+ < Input . Password
98
+ name = "password"
99
+ placeholder = "Type Your Password"
100
+ />
101
+ </ Form . Item >
102
+ </ Col >
103
+ </ Row >
104
+
105
+ < Row gutter = { 8 } >
106
+ < Col span = { 24 } >
107
+ < Form . Item
108
+ name = "firstName"
109
+ hasFeedback = { true }
110
+ showValidateSuccess = { true }
111
+ >
112
+ < Input
113
+ name = "firstName"
114
+ placeholder = "Firstname"
115
+ />
116
+ </ Form . Item >
117
+ </ Col >
118
+ </ Row >
119
+
120
+ < Row gutter = { 8 } >
121
+ < Col span = { 24 } >
122
+ < Form . Item
123
+ name = "lastName"
124
+ hasFeedback = { true }
125
+ showValidateSuccess = { true }
126
+ >
127
+ < Input
128
+ name = "lastName"
129
+ placeholder = "Lastname"
130
+ />
131
+ </ Form . Item >
132
+ </ Col >
133
+ </ Row >
134
+
86
135
< Row gutter = { 8 } >
87
136
< Col span = { 24 } className = "center" >
88
137
< SubmitButton
@@ -91,7 +140,7 @@ export function Signup() {
91
140
disabled = { isSubmitting }
92
141
className = "login-btn"
93
142
>
94
- Confirm
143
+ Signup
95
144
</ SubmitButton >
96
145
</ Col >
97
146
</ Row >
0 commit comments