import { useState } from 'react'; import { View, Text, StyleSheet, TouchableWithoutFeedback, Keyboard, Pressable } from 'react-native'; import ResetSuccessful from './formPages/resetSuccessful'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import ForgetPasswordPage from './formPages/forgetPasswordPage'; import { forgetPasswordFormData } from '../../../types/signup'; import PaginationIndicator from '../../global/PaginationIndicator'; import { router } from 'expo-router'; type ForgetPasswordFormProps = { forgetPasswordFormData: forgetPasswordFormData; setForgetPasswordFormData: React.Dispatch>; }; const ForgetPasswordForm: React.FC = ({ forgetPasswordFormData, setForgetPasswordFormData }) => { const [screen, setScreen] = useState(0); const FormTitle = ['忘記密碼 - 電話驗證']; // const goToPreviousPage = () => { // router.back(); // }; const goToPreviousPage = () => { if (router.canGoBack()) { router.back(); } else { router.replace('/(public)/login'); } }; const ScreenDisplay = () => { switch (screen) { case 0: return ( ); case 1: return ; default: return <>; } }; return ( <> {screen === 0 && ( {FormTitle[screen]} {`< 上一步`} )} {ScreenDisplay()} ); }; const styles = StyleSheet.create({ topContainer: { flex: 1, alignItems: 'center', justifyContent: 'center', paddingBottom: '25%', paddingTop: '15%' }, previouspageAndPaginationWrapper: { display: 'flex', width: '100%', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingHorizontal: 25 }, bottomContainer: { flex: 1 }, breakline: { width: 24, height: 1, backgroundColor: '#000000', marginVertical: 17 }, text: { fontSize: 24, fontWeight: '300' } }); export default ForgetPasswordForm;