This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from kkchu791/create_participant
#228: Add create participant logic for intake form
- Loading branch information
Showing
3 changed files
with
71 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react' | ||
import { Formik, Form } from 'formik' | ||
import { Button } from '@material-ui/core' | ||
import ClinicFormGroup from './ClinicFormGroup' | ||
import ContactInfoFormGroup from './ContactInfoFormGroup' | ||
import GeneralInfoFormGroup from './GeneralInfoFormGroup' | ||
import FamilyAndIncomeFormGroup from './FamilyAndIncomeFormGroup' | ||
import AgreementsFormGroup from './AgreementsFormGroup' | ||
import { Grid } from '@material-ui/core' | ||
import {createParticipant} from '../../actions/participant' | ||
|
||
const PersonalInfoForm = () => { | ||
return ( | ||
<Formik onSubmit={values => console.log(values, "onSubmit")}> | ||
{props => ( | ||
<Form> | ||
<ClinicFormGroup {...props} /> | ||
<ContactInfoFormGroup {...props} /> | ||
<GeneralInfoFormGroup {...props} /> | ||
<FamilyAndIncomeFormGroup {...props} /> | ||
<AgreementsFormGroup {...props} /> | ||
{/*The rest of the form groups could go here */} | ||
<br /> | ||
<br /> | ||
<Grid container justify="center" spacing={4}> | ||
<Grid item xs={6}> | ||
<Button | ||
variant="contained" | ||
size="large" | ||
color="default" | ||
onClick={() => createParticipant(props.values)} | ||
> | ||
Save and Exit | ||
</Button> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<Button | ||
variant="contained" | ||
size="large" | ||
color="primary" | ||
onClick={() => createParticipant(props.values)} | ||
> | ||
Save and Continue | ||
</Button> | ||
</Grid> | ||
</Grid> | ||
</Form> | ||
)} | ||
</Formik> | ||
) | ||
} | ||
|
||
export default PersonalInfoForm |