@@ -11,18 +11,24 @@ const { Title } = Typography;
1111
1212const SignupScheme = Yup . object ( {
1313 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' ) ,
1417} ) ;
1518
1619export function Signup ( ) {
1720 const history = useHistory ( ) ;
1821
1922 const initialValues = {
20- email : 'emailq' ,
23+ email : 'emailq@sdl.com' ,
24+ password : 'password' ,
25+ firstName : 'firstName' ,
26+ lastName : 'lastName' ,
2127 } ;
2228
2329 function handleSignup ( values , { setErrors, setSubmitting } ) {
2430 const CREDENTIALS = {
25- url : `auth /users/reset-password ` ,
31+ url : `/users` ,
2632 method : 'post' ,
2733 data : values ,
2834 setErrors,
@@ -38,9 +44,7 @@ export function Signup() {
3844 }
3945
4046 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...` ) ;
4448 redirectToLogin ( ) ;
4549 }
4650
@@ -58,7 +62,7 @@ export function Signup() {
5862 Signup
5963 </ Title >
6064 < p className = "center" style = { { marginBottom : '30px' } } >
61- Enter your email below.
65+ Enter your details below.
6266 </ p >
6367
6468 < Formik
@@ -83,6 +87,51 @@ export function Signup() {
8387 </ Col >
8488 </ Row >
8589
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+
86135 < Row gutter = { 8 } >
87136 < Col span = { 24 } className = "center" >
88137 < SubmitButton
@@ -91,7 +140,7 @@ export function Signup() {
91140 disabled = { isSubmitting }
92141 className = "login-btn"
93142 >
94- Confirm
143+ Signup
95144 </ SubmitButton >
96145 </ Col >
97146 </ Row >
0 commit comments