11import React , { useState } from "react" ;
22import StepWizard from 'react-step-wizard' ;
3- import { useForm , useStep } from "react-hooks-helper" ;
3+ import { useForm } from "react-hooks-helper" ;
44import StepOne from "./stepOne" ;
55import StepTwo from "./stepTwo" ;
66import StepThree from "./stepThree" ;
@@ -14,25 +14,49 @@ const defaultData = {
1414 dfidStudyNumberPatient : "" ,
1515 optionsGender : "" ,
1616 optionTypeDiabetes : "" ,
17- dobPatient : "" ,
17+
18+ additionalCommentsPatient : "" ,
19+ optionsSignsDR : "" ,
20+
21+ optionsSymptoms : "" ,
22+ otherSymptoms : "" ,
23+ optionsDiabetesTherapy : "" ,
24+ mostRecentHbA1c : "" ,
25+ optionsVisualAquity : "" ,
26+ optionsIntraOcularPressure : "" ,
27+ otherOccularFindings : ""
1828 } ;
1929
2030const MultiStepForm = ( ) => {
21- const [ dobDate , setDobDate ] = useState ( new Date ( ) ) ;
31+ //StepOne
2232 const [ formData , setForm ] = useForm ( defaultData ) ;
23- const props = { formData, setForm, dobDate, setDobDate } ;
24-
25-
26- return (
27- < StepWizard { ...props } >
28- < StepOne { ...props } />
29- < StepTwo { ...props } />
30- < StepThree { ...props } />
31- < ReviewNewPatientDetails { ...props } />
32- < SubmitPatientForm { ...props } />
33- </ StepWizard >
34- )
35-
36- } ;
33+ const [ dobPatient , setDobPatient ] = useState ( new Date ( ) ) ;
34+ const [ yearDMPatient , setYearDMPatient ] = useState ( new Date ( ) ) ;
35+
36+ //StepTwo
37+ const [ pictureR1 , setPictureR1 ] = useState ( null ) ;
38+ const [ pictureR2 , setPictureR2 ] = useState ( null ) ;
39+ const [ pictureL1 , setPictureL1 ] = useState ( null ) ;
40+ const [ pictureL2 , setPictureL2 ] = useState ( null ) ;
41+
42+ const [ dateElectronicReferal , setDateElectronicReferal ] = useState ( new Date ( ) ) ;
43+
44+ //StepThree
45+ const [ dateImagesTaken , setDateImagesTaken ] = useState ( new Date ( ) ) ;
46+ const [ dateHbA1ctaken , setDateHbA1ctaken ] = useState ( new Date ( ) ) ;
47+ const [ dateReviewNurse , setDateReviewNurse ] = useState ( new Date ( ) ) ;
48+
49+ const props = { formData, setForm, dobPatient, setDobPatient, yearDMPatient, setYearDMPatient, pictureR1, setPictureR1, pictureR2, setPictureR2, pictureL1, setPictureL1, pictureL2, setPictureL2, dateImagesTaken, setDateImagesTaken, dateElectronicReferal, setDateElectronicReferal, dateHbA1ctaken, setDateHbA1ctaken, dateReviewNurse, setDateReviewNurse} ;
50+
51+ return (
52+ < StepWizard { ...props } >
53+ < StepOne { ...props } />
54+ < StepTwo { ...props } />
55+ < StepThree { ...props } />
56+ < ReviewNewPatientDetails { ...props } />
57+ < SubmitPatientForm { ...props } />
58+ </ StepWizard >
59+ ) ;
60+ }
3761
3862export default MultiStepForm ;
0 commit comments