From 89f93aa46b7fb564cdc5bbc94f6361a6583deeba Mon Sep 17 00:00:00 2001 From: Mochammad Adhi Buchori Date: Thu, 24 Apr 2025 23:48:39 +0700 Subject: [PATCH] Refactor Passport Application flow by splitting each step into separate components and finalize Step 3 logic --- .../dialog/DialogPersonalDataRequirement.tsx | 0 src/screens/regularPassport/index.tsx | 755 ++---------------- .../Step1PersonalInfoSubStep1.tsx | 54 ++ .../Step1PersonalInfoSubStep2.tsx | 48 ++ .../Step1PersonalInfoSubStep3.tsx | 89 +++ .../Step2SupportingDocsSubStep1.tsx | 62 ++ .../Step2SupportingDocsSubStep10.tsx | 72 ++ .../Step2SupportingDocsSubStep11.tsx | 100 +++ .../Step2SupportingDocsSubStep2.tsx | 97 +++ .../Step2SupportingDocsSubStep3.tsx | 76 ++ .../Step2SupportingDocsSubStep4.tsx | 64 ++ .../Step2SupportingDocsSubStep5.tsx | 64 ++ .../Step2SupportingDocsSubStep6.tsx | 64 ++ .../Step2SupportingDocsSubStep7.tsx | 69 ++ .../Step2SupportingDocsSubStep8.tsx | 53 ++ .../Step2SupportingDocsSubStep9.tsx | 64 ++ .../steps/Step3Payment/Step3Payment.tsx | 120 ++- src/screens/regularPassport/steps/styles.tsx | 67 +- 18 files changed, 1208 insertions(+), 710 deletions(-) create mode 100644 src/components/dialog/DialogPersonalDataRequirement.tsx diff --git a/src/components/dialog/DialogPersonalDataRequirement.tsx b/src/components/dialog/DialogPersonalDataRequirement.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/screens/regularPassport/index.tsx b/src/screens/regularPassport/index.tsx index 681799e..9364bc1 100644 --- a/src/screens/regularPassport/index.tsx +++ b/src/screens/regularPassport/index.tsx @@ -17,12 +17,10 @@ import {NativeStackNavigationProp} from '@react-navigation/native-stack'; import {Button, PaperProvider} from 'react-native-paper'; import StepIndicator from '../../components/StepIndicator'; import TextInputComponent from '../../components/TextInput'; -import genderData from '../../data/DropdownData/GenderData'; import DialogApplicationPassport from '../../components/dialog/DialogApplicationPassport'; import DialogDontHaveYetPassport from '../../components/dialog/DialogDontHaveYetPassport'; import DialogPassportInfo from '../../components/dialog/DialogPassportInfo'; import DialogLostOrDamagedPassport from '../../components/dialog/DialogLostOrDamagedPassport'; -import destinationCountryData from '../../data/DropdownData/DestinationCountryData'; import familyRelationshipData from '../../data/DropdownData/FamilyRelationshipData'; import FontFamily from '../../../assets/styles/FontFamily'; import passportAppointmentData from '../../data/History/PassportAppointmentData'; @@ -32,19 +30,28 @@ import Step5Verification from './steps/Step5Verification/Step5Verification'; import Step3Payment from './steps/Step3Payment/Step3Payment'; // Data -import civilStatusData from '../../data/DropdownData/CivilStatusData'; import arrivalDateGuidelinesData from '../../data/Steps/ArrivalDateGuidelinesData'; // Options Data import passportForOptions from '../../data/Options/PassportForOptions'; -import hasHadPassportBeforeOptions from '../../data/Options/HasHadPassportBeforeOptions'; -import previousPassportConditionOptions from '../../data/Options/PreviousPassportConditionOptions'; -import passportApplicationPurposeOptions from '../../data/Options/PassportApplicationPurposeOptions'; -import destinationCountryOptions from '../../data/Options/destinationCountryOptions'; import durationAbroadOptions from '../../data/Options/DurationAbroadOptions'; import destinationFamilyContactOptions from '../../data/Options/DestinationFamilyContactOptions'; import Step4DataConfirmationSubStep2 from './steps/Step4DataConfirmation/Step4DataConfirmationSubStep2'; import Step4DataConfirmationSubStep1 from './steps/Step4DataConfirmation/Step4DataConfirmationSubStep1'; +import Step1PersonalInfoSubStep1 from './steps/Step1PersonalInfo/Step1PersonalInfoSubStep1'; +import Step1PersonalInfoSubStep2 from './steps/Step1PersonalInfo/Step1PersonalInfoSubStep2'; +import Step1PersonalInfoSubStep3 from './steps/Step1PersonalInfo/Step1PersonalInfoSubStep3'; +import Step2SupportingDocsSubStep1 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep1'; +import Step2SupportingDocsSubStep2 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep2'; +import Step2SupportingDocsSubStep3 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep3'; +import Step2SupportingDocsSubStep4 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep4'; +import Step2SupportingDocsSubStep5 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep5'; +import Step2SupportingDocsSubStep6 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep6'; +import Step2SupportingDocsSubStep7 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep7'; +import Step2SupportingDocsSubStep8 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep8'; +import Step2SupportingDocsSubStep9 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep9'; +import Step2SupportingDocsSubStep10 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep10'; +import Step2SupportingDocsSubStep11 from './steps/Step2SupportingDocs/Step2SupportingDocsSubStep11'; type RegularPassportScreenNavigationProp = NativeStackNavigationProp< RootStackParamList, @@ -58,6 +65,8 @@ type RenderApplicationStepsContentProps = { setSubStep: (subStep: number) => void; selectedOption: string; setSelectedOption: (val: string) => void; + selectedPassportOption: string; + setSelectedPassportOption: (val: string) => void; checkedOption: boolean; setCheckedOption: React.Dispatch>; showDontHaveYetDialog: () => void; @@ -75,6 +84,8 @@ const RenderApplicationStepsContent = ( setSubStep, selectedOption, setSelectedOption, + selectedPassportOption, + setSelectedPassportOption, checkedOption, setCheckedOption, showDontHaveYetDialog, @@ -85,148 +96,15 @@ const RenderApplicationStepsContent = ( if (step === 1) { switch (subStep) { case 1: - return ( - - - - - Ambil/Upload Foto KTP Anda - - - Pastikan pencahayaan cukup, tulisan pada identitas terlihat - jelas, dan jangan gunakan foto dari Live Mode sebelum - melanjutkan. - - - - Foto KTP - - - - - - - - - ); + return ; case 2: - return ( - - - - - Ambil/Upload Foto KTP Anda - - - Pastikan pencahayaan cukup, tulisan pada identitas terlihat - jelas, dan jangan gunakan foto dari Live Mode sebelum - melanjutkan. - - - - - - - - - - ); + return ; case 3: return ( - - - - - - - - - - - - - - - - - - - - - - - - + ); default: return null; @@ -237,560 +115,66 @@ const RenderApplicationStepsContent = ( switch (subStep) { case 1: return ( - - { - setStep(1); - setSubStep(3); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - }, - ]}> - - Kembali - - - - Apakah Anda sudah pernah memiliki paspor? - - {hasHadPassportBeforeOptions.map(options => ( - { - setSelectedOption(value); - value === 'already' - ? setSubStep(2) - : showDontHaveYetDialog(); - }} - /> - ))} - - + ); case 2: return ( - - - { - setSubStep(1); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - }, - ]}> - - Kembali - - - - Bagaimana kondisi paspor lama Anda? - - showPassportInfoDialog()} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - }, - ]}> - - - Klik di sini untuk melihat informasi kondisi paspor - - - {previousPassportConditionOptions.map(options => ( - { - setSelectedOption(value); - }} - /> - ))} - - - - + ); case 3: - return ( - - - { - setSubStep(2); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - marginBottom: 8, - }, - ]}> - - Kembali - - - - Ambil/Upload Foto Paspor Lama Anda (Halaman 2 Paspor) - - - Pastikan pencahayaan cukup, tulisan pada identitas terlihat - jelas, dan jangan gunakan foto dari Live Mode sebelum - melanjutkan. - - - - - Foto Halaman 2 Paspor Lama - - - - - - - - - - ); + return ; case 4: - return ( - - - { - setSubStep(3); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - marginBottom: 8, - }, - ]}> - - Kembali - - - - Ambil/Upload Foto Paspor Lama Anda (Halaman 2 Paspor) - - - Pastikan pencahayaan cukup, tulisan pada identitas terlihat - jelas, dan jangan gunakan foto dari Live Mode sebelum - melanjutkan. - - - - - - - - - - ); + return ; case 5: - return ( - - - { - setSubStep(4); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - }, - ]}> - - Kembali - - - - - - - - Nomor paspor lama minimal 7 karakter - - - - - - Tulis nomor paspor tanpa menggunakan spasi. Contoh: - B12345678 - - - - - - - - ); + return ; case 6: return ( - - - { - setSubStep(5); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - }, - ]}> - - Kembali - - - - Apakah tujuan Anda membuat paspor? - - {passportApplicationPurposeOptions.map(options => ( - { - setSelectedOption(value); - }} - /> - ))} - - - - + ); case 7: return ( - - - { - setSubStep(6); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - }, - ]}> - - Kembali - - - - {destinationCountryOptions.map(options => ( - { - setSelectedOption(value); - }} - /> - ))} - - - - + ); case 8: - return ( - - - { - setSubStep(7); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - }, - ]}> - - Kembali - - - - - - - - ); + return ; case 9: return ( - - - { - setSubStep(8); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - }, - ]}> - - Kembali - - - - Berapa lama Anda berencana berada di luar negeri? - - {durationAbroadOptions.map(options => ( - setSelectedOption(value)} - /> - ))} - - - - + ); case 10: - return ( - - - { - setSubStep(9); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - marginBottom: 8, - }, - ]}> - - Kembali - - - - Nomor telepon keluarga/kerabat terdekat Anda di Indonesia yang - dapat dihubungi - - - - - - - - - ); + return ; case 11: return ( - - - { - setSubStep(10); - }} - style={({pressed}) => [ - styles.subStepButtonBackWrapper, - { - transform: [{scale: pressed ? 0.99 : 1}], - marginBottom: 8, - }, - ]}> - - Kembali - - - - - Nomor telepon keluarga/kerabat di negara tujuan - - - (Opsional) - - - - - - {destinationFamilyContactOptions.map(options => ( - { - setSelectedOption(value); - }} - /> - ))} - - - - + ); default: return null; @@ -819,7 +203,13 @@ const RenderApplicationStepsContent = ( } switch (step) { case 3: - return ; + return ( + + ); case 5: return ( void; +}; + +const Step1PersonalInfoSubStep1 = ({ + setSubStep, +}: Step1PersonalInfoSubStep1Props) => { + return ( + + + + Ambil/Upload Foto KTP Anda + + Pastikan pencahayaan cukup, tulisan pada identitas terlihat jelas, + dan jangan gunakan foto dari Live Mode sebelum melanjutkan. + + + + Foto KTP + + + + + + + + + ); +}; + +export default Step1PersonalInfoSubStep1; diff --git a/src/screens/regularPassport/steps/Step1PersonalInfo/Step1PersonalInfoSubStep2.tsx b/src/screens/regularPassport/steps/Step1PersonalInfo/Step1PersonalInfoSubStep2.tsx index e69de29..2324172 100644 --- a/src/screens/regularPassport/steps/Step1PersonalInfo/Step1PersonalInfoSubStep2.tsx +++ b/src/screens/regularPassport/steps/Step1PersonalInfo/Step1PersonalInfoSubStep2.tsx @@ -0,0 +1,48 @@ +import React from 'react'; +import {ScrollView, View, Text} from 'react-native'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step1PersonalInfoSubStep2Props = { + setSubStep: (val: number) => void; +}; + +const Step1PersonalInfoSubStep2 = ({ + setSubStep, +}: Step1PersonalInfoSubStep2Props) => { + return ( + + + + Ambil/Upload Foto KTP Anda + + Pastikan pencahayaan cukup, tulisan pada identitas terlihat jelas, + dan jangan gunakan foto dari Live Mode sebelum melanjutkan. + + + + + + + + + + + + ); +}; + +export default Step1PersonalInfoSubStep2; diff --git a/src/screens/regularPassport/steps/Step1PersonalInfo/Step1PersonalInfoSubStep3.tsx b/src/screens/regularPassport/steps/Step1PersonalInfo/Step1PersonalInfoSubStep3.tsx index e69de29..2eaf8cd 100644 --- a/src/screens/regularPassport/steps/Step1PersonalInfo/Step1PersonalInfoSubStep3.tsx +++ b/src/screens/regularPassport/steps/Step1PersonalInfo/Step1PersonalInfoSubStep3.tsx @@ -0,0 +1,89 @@ +import React from 'react'; +import {ScrollView, View} from 'react-native'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import TextInputComponent from '../../../../components/TextInput'; +import genderData from '../../../../data/DropdownData/GenderData'; +import civilStatusData from '../../../../data/DropdownData/CivilStatusData'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step1PersonalInfoSubStep3Props = { + setStep: (val: number) => void; + setSubStep: (val: number) => void; +}; + +const Step1PersonalInfoSubStep3 = ({ + setStep, + setSubStep, +}: Step1PersonalInfoSubStep3Props) => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +export default Step1PersonalInfoSubStep3; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep1.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep1.tsx index e69de29..9598d2a 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep1.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep1.tsx @@ -0,0 +1,62 @@ +import React from 'react'; +import {View, Pressable, Text} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import styles from '../styles'; +import RadioButtonOptionComponent from '../../../../components/RadioButtonOption'; +import hasHadPassportBeforeOptions from '../../../../data/Options/HasHadPassportBeforeOptions'; + +type Step2SupportingDocsSubStep1Props = { + setStep: (step: number) => void; + setSubStep: (subStep: number) => void; + selectedPassportOption: string; + setSelectedPassportOption: (value: string) => void; + showDontHaveYetDialog: () => void; +}; + +const Step2SupportingDocsSubStep1 = ({ + setStep, + setSubStep, + selectedPassportOption, + setSelectedPassportOption, + showDontHaveYetDialog, +}: Step2SupportingDocsSubStep1Props) => { + return ( + + { + setStep(1); + setSubStep(3); + }} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + }, + ]}> + + Kembali + + + + + Apakah Anda sudah pernah memiliki paspor? + + {hasHadPassportBeforeOptions.map(option => ( + { + setSelectedPassportOption(value); + value === 'already' ? setSubStep(2) : showDontHaveYetDialog(); + }} + /> + ))} + + + ); +}; + +export default Step2SupportingDocsSubStep1; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep10.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep10.tsx index e69de29..d19f5ef 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep10.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep10.tsx @@ -0,0 +1,72 @@ +import React from 'react'; +import {ScrollView, View, Text, Pressable} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import TextInputComponent from '../../../../components/TextInput'; +import Colors from '../../../../../assets/styles/Colors'; +import familyRelationshipData from '../../../../data/DropdownData/FamilyRelationshipData'; + +type Step2SupportingDocsSubStep10Props = { + setSubStep: (step: number) => void; +}; + +const Step2SupportingDocsSubStep10 = ({ + setSubStep, +}: Step2SupportingDocsSubStep10Props) => { + return ( + + + setSubStep(9)} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + marginBottom: 8, + }, + ]}> + + Kembali + + + + + Nomor telepon keluarga/kerabat terdekat Anda di Indonesia yang dapat + dihubungi + + + + + + + + + + + + + ); +}; + +export default Step2SupportingDocsSubStep10; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep11.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep11.tsx index e69de29..fca916d 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep11.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep11.tsx @@ -0,0 +1,100 @@ +import React from 'react'; +import {ScrollView, View, Text, Pressable} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import FontFamily from '../../../../../assets/styles/FontFamily'; +import TextInputComponent from '../../../../components/TextInput'; +import destinationFamilyContactOptions from '../../../../data/Options/DestinationFamilyContactOptions'; +import familyRelationshipData from '../../../../data/DropdownData/FamilyRelationshipData'; +import RadioButtonOptionComponent from '../../../../components/RadioButtonOption'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step2SupportingDocsSubStep11Props = { + setStep: (step: number) => void; + setSubStep: (subStep: number) => void; + selectedOption: string; + setSelectedOption: (value: string) => void; +}; + +const Step2SupportingDocsSubStep11 = ({ + setStep, + setSubStep, + selectedOption, + setSelectedOption, +}: Step2SupportingDocsSubStep11Props) => { + return ( + + + setSubStep(10)} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + marginBottom: 8, + }, + ]}> + + Kembali + + + + + + Nomor telepon keluarga/kerabat di negara tujuan + + + (Opsional) + + + + + + + + + + {destinationFamilyContactOptions.map(options => ( + setSelectedOption(value)} + /> + ))} + + + + + + ); +}; + +export default Step2SupportingDocsSubStep11; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep2.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep2.tsx index e69de29..4c29133 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep2.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep2.tsx @@ -0,0 +1,97 @@ +import React from 'react'; +import {ScrollView, View, Pressable, Text} from 'react-native'; +import {Button} from 'react-native-paper'; +import previousPassportConditionOptions from '../../../../data/Options/PreviousPassportConditionOptions'; +import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; +import Colors from '../../../../../assets/styles/Colors'; +import RadioButtonOptionComponent from '../../../../components/RadioButtonOption'; +import styles from '../styles'; + +type Step2SupportingDocsSubStep2Props = { + setSubStep: (step: number) => void; + selectedOption: string; + setSelectedOption: (value: string) => void; + showPassportInfoDialog: () => void; + showLostOrDamagedPassportDialog: () => void; +}; + +const Step2SupportingDocsSubStep2 = ({ + setSubStep, + selectedOption, + setSelectedOption, + showPassportInfoDialog, + showLostOrDamagedPassportDialog, +}: Step2SupportingDocsSubStep2Props) => { + return ( + + + { + setSubStep(1); + }} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + {transform: [{scale: pressed ? 0.99 : 1}]}, + ]}> + + Kembali + + + + + Bagaimana kondisi paspor lama Anda? + + + [ + styles.subStepButtonBackWrapper, + {transform: [{scale: pressed ? 0.99 : 1}]}, + ]}> + + + Klik di sini untuk melihat informasi kondisi paspor + + + + {previousPassportConditionOptions.map(option => ( + + ))} + + + + + + ); +}; + +export default Step2SupportingDocsSubStep2; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep3.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep3.tsx index e69de29..e8f4f66 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep3.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep3.tsx @@ -0,0 +1,76 @@ +import React from 'react'; +import {ScrollView, View, Pressable, Text} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step2SupportingDocsSubStep3Props = { + setSubStep: (step: number) => void; +}; + +const Step2SupportingDocsSubStep3 = ({ + setSubStep, +}: Step2SupportingDocsSubStep3Props) => { + return ( + + + { + setSubStep(2); + }} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + marginBottom: 8, + }, + ]}> + + Kembali + + + + + Ambil/Upload Foto Paspor Lama Anda (Halaman 2 Paspor) + + + Pastikan pencahayaan cukup, tulisan pada identitas terlihat jelas, + dan jangan gunakan foto dari Live Mode sebelum melanjutkan. + + + + + + Foto Halaman 2 Paspor Lama + + + + + + + + + + + ); +}; + +export default Step2SupportingDocsSubStep3; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep4.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep4.tsx index e69de29..e9088a2 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep4.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep4.tsx @@ -0,0 +1,64 @@ +import React from 'react'; +import {ScrollView, View, Pressable, Text} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step2SupportingDocsSubStep4Props = { + setSubStep: (step: number) => void; +}; + +const Step2SupportingDocsSubStep4 = ({ + setSubStep, +}: Step2SupportingDocsSubStep4Props) => { + return ( + + + setSubStep(3)} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + marginBottom: 8, + }, + ]}> + + Kembali + + + + + Ambil/Upload Foto Paspor Lama Anda (Halaman 2 Paspor) + + + Pastikan pencahayaan cukup, tulisan pada identitas terlihat jelas, + dan jangan gunakan foto dari Live Mode sebelum melanjutkan. + + + + + + + + + + + + ); +}; + +export default Step2SupportingDocsSubStep4; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep5.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep5.tsx index e69de29..76c8971 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep5.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep5.tsx @@ -0,0 +1,64 @@ +import React from 'react'; +import {ScrollView, View, Text, Pressable} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import TextInputComponent from '../../../../components/TextInput'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step2SupportingDocsSubStep5Props = { + setSubStep: (step: number) => void; +}; + +const Step2SupportingDocsSubStep5 = ({ + setSubStep, +}: Step2SupportingDocsSubStep5Props) => { + return ( + + + setSubStep(4)} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + }, + ]}> + + Kembali + + + + + + + + + Nomor paspor lama minimal 7 karakter + + + + + + Tulis nomor paspor tanpa menggunakan spasi. Contoh: B12345678 + + + + + + + + + ); +}; + +export default Step2SupportingDocsSubStep5; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep6.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep6.tsx index e69de29..bb337ba 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep6.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep6.tsx @@ -0,0 +1,64 @@ +import React from 'react'; +import {ScrollView, View, Text, Pressable} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import {Button} from 'react-native-paper'; +import passportApplicationPurposeOptions from '../../../../data/Options/PassportApplicationPurposeOptions'; +import styles from '../styles'; +import RadioButtonOptionComponent from '../../../../components/RadioButtonOption'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step2SupportingDocsSubStep6Props = { + setSubStep: (step: number) => void; + selectedOption: string; + setSelectedOption: (val: string) => void; +}; + +const Step2SupportingDocsSubStep6 = ({ + setSubStep, + selectedOption, + setSelectedOption, +}: Step2SupportingDocsSubStep6Props) => { + return ( + + + setSubStep(5)} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + }, + ]}> + + Kembali + + + + + Apakah tujuan Anda membuat paspor? + + {passportApplicationPurposeOptions.map(option => ( + setSelectedOption(value)} + /> + ))} + + + + + + ); +}; + +export default Step2SupportingDocsSubStep6; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep7.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep7.tsx index e69de29..49dfe71 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep7.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep7.tsx @@ -0,0 +1,69 @@ +import React from 'react'; +import {ScrollView, View, Text, Pressable} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import TextInputComponent from '../../../../components/TextInput'; +import RadioButtonOptionComponent from '../../../../components/RadioButtonOption'; +import destinationCountryOptions from '../../../../data/Options/DestinationCountryOptions'; +import destinationCountryData from '../../../../data/DropdownData/DestinationCountryData'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step2SupportingDocsSubStep7Props = { + setSubStep: (step: number) => void; + selectedOption: string; + setSelectedOption: (val: string) => void; +}; + +const Step2SupportingDocsSubStep7 = ({ + setSubStep, + selectedOption, + setSelectedOption, +}: Step2SupportingDocsSubStep7Props) => { + return ( + + + setSubStep(6)} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + }, + ]}> + + Kembali + + + + + {destinationCountryOptions.map(option => ( + setSelectedOption(value)} + /> + ))} + + + + + + ); +}; + +export default Step2SupportingDocsSubStep7; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep8.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep8.tsx index e69de29..5163beb 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep8.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep8.tsx @@ -0,0 +1,53 @@ +import React from 'react'; +import {ScrollView, View, Text, Pressable} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import TextInputComponent from '../../../../components/TextInput'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step2SupportingDocsSubStep8Props = { + setSubStep: (step: number) => void; +}; + +const Step2SupportingDocsSubStep8 = ({ + setSubStep, +}: Step2SupportingDocsSubStep8Props) => { + return ( + + + setSubStep(7)} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + }, + ]}> + + Kembali + + + + + + + + + + ); +}; + +export default Step2SupportingDocsSubStep8; diff --git a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep9.tsx b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep9.tsx index e69de29..18d659c 100644 --- a/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep9.tsx +++ b/src/screens/regularPassport/steps/Step2SupportingDocs/Step2SupportingDocsSubStep9.tsx @@ -0,0 +1,64 @@ +import React from 'react'; +import {ScrollView, View, Text, Pressable} from 'react-native'; +import Icon from 'react-native-vector-icons/Feather'; +import {Button} from 'react-native-paper'; +import styles from '../styles'; +import durationAbroadOptions from '../../../../data/Options/DurationAbroadOptions'; +import RadioButtonOptionComponent from '../../../../components/RadioButtonOption'; +import Colors from '../../../../../assets/styles/Colors'; + +type Step2SupportingDocsSubStep9Props = { + setSubStep: (step: number) => void; + selectedOption: string; + setSelectedOption: (value: string) => void; +}; + +const Step2SupportingDocsSubStep9 = ({ + setSubStep, + selectedOption, + setSelectedOption, +}: Step2SupportingDocsSubStep9Props) => { + return ( + + + setSubStep(8)} + style={({pressed}) => [ + styles.subStepButtonBackWrapper, + { + transform: [{scale: pressed ? 0.99 : 1}], + }, + ]}> + + Kembali + + + + + Berapa lama Anda berencana berada di luar negeri? + + {durationAbroadOptions.map(options => ( + setSelectedOption(value)} + /> + ))} + + + + + + ); +}; + +export default Step2SupportingDocsSubStep9; diff --git a/src/screens/regularPassport/steps/Step3Payment/Step3Payment.tsx b/src/screens/regularPassport/steps/Step3Payment/Step3Payment.tsx index 16f2c22..6b656c9 100644 --- a/src/screens/regularPassport/steps/Step3Payment/Step3Payment.tsx +++ b/src/screens/regularPassport/steps/Step3Payment/Step3Payment.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, {useState} from 'react'; import {ScrollView, View, Text, Pressable} from 'react-native'; import styles from '../styles'; import Colors from '../../../../../assets/styles/Colors'; @@ -15,11 +15,13 @@ interface BackButtonProps { interface DocumentUploadSectionProps { title: string; isRequired?: boolean; + isIcon?: boolean; } interface Step3PaymentProps { setStep: (step: number) => void; setSubStep: (subStep: number) => void; + selectedPassportOption: string; } const BackButton = (props: BackButtonProps) => { @@ -41,39 +43,90 @@ const BackButton = (props: BackButtonProps) => { }; const DocumentUploadSection = (props: DocumentUploadSectionProps) => { - const {title, isRequired = false} = props; + const {title, isRequired, isIcon} = props; + const [uploadedFileName, setUploadedFileName] = useState(null); + + const handleUpload = (p0: string) => { + let fileName = `${title.toLowerCase().replace(/ /g, '')}.jpg`; + + if ( + title === 'Akta kelahiran/ijazah/akta perkawinan/buku nikah/surat baptis' + ) { + fileName = 'ijazah.jpg'; + } + + setUploadedFileName(fileName); + }; + + const handleDelete = () => { + setUploadedFileName(null); + }; + return ( - - {title}{' '} - {isRequired && ( - * + + + {title}{' '} + {isRequired && ( + * + )} + + {isIcon && ( + )} - - - - + + {!uploadedFileName ? ( + + + + + + ) : ( + + + + Berhasil dipilih + + + {uploadedFileName} + + + + + )} ); }; const Step3Payment = (props: Step3PaymentProps) => { - const {setStep, setSubStep} = props; + const {setStep, setSubStep, selectedPassportOption} = props; + console.log('selectedPassportOption', selectedPassportOption); return ( @@ -87,7 +140,13 @@ const Step3Payment = (props: Step3PaymentProps) => { Layanan yang cocok untuk Anda adalah{' '} - Paspor Penggantian + {selectedPassportOption !== 'already' ? ( + + Paspor Penggantian + + ) : ( + Paspor Baru + )} . Silakan unggah kelengkapan dokumen berikut. @@ -166,8 +225,13 @@ const Step3Payment = (props: Step3PaymentProps) => { - - + + {selectedPassportOption !== 'already' && ( + + )}