Browse Source

Adding scroll view to change password screens

master
GabrielTrettel 3 years ago
parent
commit
de94d72999
  1. 3
      src/app/screens/PasswordRecoveryChangePswdScreen.js
  2. 9
      src/app/screens/PasswordRecoveryScreen.js

3
src/app/screens/PasswordRecoveryChangePswdScreen.js

@ -8,6 +8,7 @@ import { dimensions } from "../config/dimensions";
import PasswordFormField from "../components/forms/PasswordFormField";
import ConfirmationModal from "../components/ConfirmationModal";
import { updatePassword } from "../api/auth";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
const validationSchema = Yup.object().shape({
password: Yup.string()
@ -81,6 +82,7 @@ export default function PasswordRecoveryChangePswd({ navigation, route }) {
}}
/>
<KeyboardAwareScrollView>
<Form
validationSchema={validationSchema}
initialValues={{
@ -129,6 +131,7 @@ export default function PasswordRecoveryChangePswd({ navigation, route }) {
<SubmitButton title="confirmar" backgroundColor={colors.primary} />
</Form>
</KeyboardAwareScrollView>
</View>
);
}

9
src/app/screens/PasswordRecoveryScreen.js

@ -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>
);
}

Loading…
Cancel
Save