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