multi_step_form.tsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { View, StyleSheet, ScrollView } from 'react-native';
  2. import { StatusBar } from 'expo-status-bar';
  3. import { useEffect } from 'react';
  4. import useSignUpStore from '../../providers/signup_form_store';
  5. import Form from '../registrationMultiStepForm/formComponent/form';
  6. import { SafeAreaView } from 'react-native-safe-area-context';
  7. import useVehicleStore from '../../providers/vehicle_store';
  8. const MultiStepForm: React.FC = () => {
  9. const { signUpFormData } = useSignUpStore();
  10. const {
  11. vehicleBrand,
  12. vehicleModel,
  13. BrandID,
  14. ModelID,
  15. licensePlate,
  16. setVehicleBrand,
  17. setVehicleModel,
  18. setBrandID,
  19. setModelID,
  20. setLicensePlate
  21. } = useVehicleStore();
  22. // logging to check if parent component can successfully receive user input in the multi-step form
  23. useEffect(() => {
  24. console.log('Current Zustand Store:', signUpFormData);
  25. console.log(
  26. 'VehicleStore',
  27. vehicleBrand,
  28. vehicleModel,
  29. 'BrandID',
  30. BrandID,
  31. 'ModelID',
  32. ModelID,
  33. 'licensePlate',
  34. licensePlate
  35. );
  36. }, [signUpFormData]);
  37. return (
  38. <SafeAreaView className="flex-1 bg-white" edges={['top', 'left', 'right']}>
  39. <ScrollView className="flex-1" showsVerticalScrollIndicator={false}>
  40. <View style={styles.container}>
  41. <Form />
  42. <StatusBar style="auto" />
  43. </View>
  44. </ScrollView>
  45. </SafeAreaView>
  46. );
  47. };
  48. const styles = StyleSheet.create({
  49. container: {
  50. flex: 1,
  51. backgroundColor: '#FFFFFF'
  52. }
  53. });
  54. export default MultiStepForm;