|
@ -9,6 +9,7 @@ import PhoneNumberFormField from "../components/forms/PhoneNumberFormField"; |
|
|
import SearchablePicker from "../components/SearchablePicker"; |
|
|
import SearchablePicker from "../components/SearchablePicker"; |
|
|
import ConfirmationModal from "../components/ConfirmationModal"; |
|
|
import ConfirmationModal from "../components/ConfirmationModal"; |
|
|
import { loginByUsernamAnswers, existUsername } from "../api/auth"; |
|
|
import { loginByUsernamAnswers, existUsername } from "../api/auth"; |
|
|
|
|
|
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; |
|
|
|
|
|
|
|
|
function SecQuestionPicker({ name }) { |
|
|
function SecQuestionPicker({ name }) { |
|
|
const [items, setItems] = useState([ |
|
|
const [items, setItems] = useState([ |
|
@ -67,7 +68,6 @@ const validationSchema = Yup.object().shape({ |
|
|
|
|
|
|
|
|
export default function PasswordRecovery({ navigation, route }) { |
|
|
export default function PasswordRecovery({ navigation, route }) { |
|
|
const user = route.params.user; |
|
|
const user = route.params.user; |
|
|
console.log(user) |
|
|
|
|
|
|
|
|
|
|
|
const [showLoading, setShowLoading] = useState(false); |
|
|
const [showLoading, setShowLoading] = useState(false); |
|
|
const [confirmatioModalData, setConfirmatioModalData] = useState({ |
|
|
const [confirmatioModalData, setConfirmatioModalData] = useState({ |
|
@ -78,8 +78,8 @@ export default function PasswordRecovery({ navigation, route }) { |
|
|
const handleSubmit = async (number, answer, secQuestion) => { |
|
|
const handleSubmit = async (number, answer, secQuestion) => { |
|
|
setShowLoading(true); |
|
|
setShowLoading(true); |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
console.log("to rodando", showLoading) |
|
|
|
|
|
showLoading && setConfirmatioModalData({ |
|
|
|
|
|
|
|
|
showLoading && |
|
|
|
|
|
setConfirmatioModalData({ |
|
|
message: "Validando informações", |
|
|
message: "Validando informações", |
|
|
show: true, |
|
|
show: true, |
|
|
}); |
|
|
}); |
|
@ -104,7 +104,6 @@ export default function PasswordRecovery({ navigation, route }) { |
|
|
|
|
|
|
|
|
switch (apiResponse.status) { |
|
|
switch (apiResponse.status) { |
|
|
case 200: |
|
|
case 200: |
|
|
console.log("ir pra proxima tela...."); |
|
|
|
|
|
navigation.navigate("PasswordRecoveryChangePswd", { |
|
|
navigation.navigate("PasswordRecoveryChangePswd", { |
|
|
authToken: apiResponse.data, |
|
|
authToken: apiResponse.data, |
|
|
username: number, |
|
|
username: number, |
|
@ -142,6 +141,7 @@ export default function PasswordRecovery({ navigation, route }) { |
|
|
} |
|
|
} |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<KeyboardAwareScrollView> |
|
|
<Form |
|
|
<Form |
|
|
validationSchema={validationSchema} |
|
|
validationSchema={validationSchema} |
|
|
initialValues={{ |
|
|
initialValues={{ |
|
@ -187,6 +187,7 @@ export default function PasswordRecovery({ navigation, route }) { |
|
|
|
|
|
|
|
|
<SubmitButton title="próximo" backgroundColor={colors.primary} /> |
|
|
<SubmitButton title="próximo" backgroundColor={colors.primary} /> |
|
|
</Form> |
|
|
</Form> |
|
|
|
|
|
</KeyboardAwareScrollView> |
|
|
</View> |
|
|
</View> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|