Commit 7f2c8be 1 parent f28d5f3 commit 7f2c8be Copy full SHA for 7f2c8be
File tree 1 file changed +12
-7
lines changed
airbyte-webapp/src/packages/cloud/views/auth/SignupPage/components
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { Field , FieldProps , Formik } from "formik" ;
2
2
import React , { useMemo } from "react" ;
3
3
import { FormattedMessage , useIntl } from "react-intl" ;
4
+ import { useSearchParams } from "react-router-dom" ;
4
5
import styled from "styled-components" ;
5
6
import * as yup from "yup" ;
6
7
@@ -195,15 +196,19 @@ export const SignupForm: React.FC = () => {
195
196
return yup . object ( ) . shape ( shape ) ;
196
197
} , [ showName , showCompanyName ] ) ;
197
198
199
+ const [ params ] = useSearchParams ( ) ;
200
+ const search = Object . fromEntries ( params ) ;
201
+
202
+ const initialValues = {
203
+ name : `${ search . firstname ?? "" } ${ search . lastname ?? "" } ` . trim ( ) ,
204
+ companyName : search . company ?? "" ,
205
+ email : search . email ?? "" ,
206
+ password : "" ,
207
+ news : true ,
208
+ } ;
198
209
return (
199
210
< Formik < FormValues >
200
- initialValues = { {
201
- name : "" ,
202
- companyName : "" ,
203
- email : "" ,
204
- password : "" ,
205
- news : true ,
206
- } }
211
+ initialValues = { initialValues }
207
212
validationSchema = { validationSchema }
208
213
onSubmit = { async ( values , { setFieldError, setStatus } ) =>
209
214
signUp ( values ) . catch ( ( err ) => {
You can’t perform that action at this time.
0 commit comments