|
@@ -18,7 +18,8 @@ const SignUpSchema = yup.object({
|
|
|
first_name: yup.string().required(),
|
|
|
last_name: yup.string().required(),
|
|
|
date_of_birth: yup.string().required(),
|
|
|
- homebase: yup.number().required()
|
|
|
+ homebase: yup.number().required(),
|
|
|
+ homebase2: yup.number().optional()
|
|
|
});
|
|
|
|
|
|
//TODO: formik avatar | date and flatlist error shown
|
|
@@ -33,6 +34,7 @@ const EditAccount = () => {
|
|
|
if (data) {
|
|
|
if (data.token) {
|
|
|
storageSet('token', data.token);
|
|
|
+ storageSet('uid', data.uid.toString());
|
|
|
dispatch(
|
|
|
CommonActions.reset({
|
|
|
index: 1,
|
|
@@ -59,7 +61,8 @@ const EditAccount = () => {
|
|
|
first_name: '',
|
|
|
last_name: '',
|
|
|
date_of_birth: '',
|
|
|
- homebase: 0
|
|
|
+ homebase: 0,
|
|
|
+ homebase2: undefined
|
|
|
}}
|
|
|
validationSchema={SignUpSchema}
|
|
|
onSubmit={(values) => {
|
|
@@ -69,7 +72,8 @@ const EditAccount = () => {
|
|
|
first_name: values.first_name,
|
|
|
last_name: values.last_name,
|
|
|
date_of_birth: values.date_of_birth,
|
|
|
- homebase: values.homebase
|
|
|
+ homebase: values.homebase,
|
|
|
+ homebase2: values.homebase2
|
|
|
},
|
|
|
photo: {
|
|
|
type: values.photo.type,
|
|
@@ -103,6 +107,7 @@ const EditAccount = () => {
|
|
|
formikError={props.touched.last_name && props.errors.last_name}
|
|
|
/>
|
|
|
<InputDatePicker
|
|
|
+ headerTitle={'Date of birth'}
|
|
|
selectedDate={(date) => props.setFieldValue('date_of_birth', date)}
|
|
|
formikError={props.touched.date_of_birth && props.errors.date_of_birth}
|
|
|
/>
|
|
@@ -112,7 +117,7 @@ const EditAccount = () => {
|
|
|
/>
|
|
|
<ModalFlatList
|
|
|
headerTitle={'Second region'}
|
|
|
- selectedObject={(data) => console.log(data)}
|
|
|
+ selectedObject={(data) => props.setFieldValue('homebase2', data.id)}
|
|
|
/>
|
|
|
<View style={{ marginTop: 10 }}>
|
|
|
<Button onPress={props.handleSubmit}>Sign up</Button>
|