|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
import { View, ScrollView } from 'react-native';
|
|
|
import { Formik } from 'formik';
|
|
|
import * as yup from 'yup';
|
|
|
+import { CommonActions, useNavigation } from '@react-navigation/native';
|
|
|
|
|
|
import { AvatarPicker, BigText, Button, Header, Input, PageWrapper } from '../../../components';
|
|
|
import { InputDatePicker } from '../../../components/Calendar/InputDatePicker';
|
|
@@ -10,6 +11,7 @@ import { useRegisterMutation } from '../../../modules/auth/api/queries/use-post-
|
|
|
import { storageSet } from '../../../storage';
|
|
|
|
|
|
import store from '../../../storage/zustand';
|
|
|
+import { NAVIGATION_PAGES } from '../../../types';
|
|
|
|
|
|
const SignUpSchema = yup.object({
|
|
|
first_name: yup.string().required(),
|
|
@@ -21,6 +23,8 @@ const SignUpSchema = yup.object({
|
|
|
//TODO: formik avatar | date and flatlist error shown
|
|
|
|
|
|
const EditAccount = () => {
|
|
|
+ const { dispatch } = useNavigation();
|
|
|
+
|
|
|
const [user] = store((state) => [state.registration.user]);
|
|
|
|
|
|
const { data, error, mutate: userRegister } = useRegisterMutation();
|
|
@@ -28,6 +32,12 @@ const EditAccount = () => {
|
|
|
if (data) {
|
|
|
if (data.token) {
|
|
|
storageSet('token', data.token);
|
|
|
+ dispatch(
|
|
|
+ CommonActions.reset({
|
|
|
+ index: 1,
|
|
|
+ routes: [{ name: NAVIGATION_PAGES.IN_APP }]
|
|
|
+ })
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|