Skip to content

Commit

Permalink
Merge diffs from WF/Nirmal/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dnil committed Oct 30, 2024
1 parent 3874f23 commit 328a857
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_APP_TITLE=UDNI tip2toe frontend
VITE_APIURL=https://phenopacket-stage.scilifelab.se
31 changes: 15 additions & 16 deletions src/components/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@ export default function Home() {
</p>
</div>
<div className="flex flex-col md:flex-row md:divide-x divide-udni-teal">
<div className="w-full p-8 flex flex-col items-center my-5 group">
<div className="flex items-center space-x-2">
<DocumentPlusIcon className="w-5 text-udni-teal" />{' '}
<div className="w-full p-8 flex flex-col items-end my-5 group">
<div className="flex flex-col items-start">
<div className="flex items-center space-x-2">
<DocumentPlusIcon className="w-5 text-udni-teal" />{' '}
<h3>Start new form</h3>
</div>
<p className="text-gray-600 text-sm">
For physicians, geneticists. Start questionnare.
</p>
<label className="mt-4">
<input
type="checkbox"
Expand Down Expand Up @@ -88,18 +86,19 @@ export default function Home() {
Start new
</Link>
</div>
<div className="w-full p-8 flex flex-col items-center my-5 ">
<div className="flex items-center space-x-2">
<DocumentArrowDownIcon className="w-5 text-udni-teal" />
<h3>Continue form</h3>
</div>
<p className="text-gray-600 text-sm">
Add images, documents to an existing form.
</p>
<ContinueForm />
</div>
<div className="w-full p-8 flex flex-col items-start my-5 ">
<div className="flex items-center space-x-2">
<DocumentArrowDownIcon className="w-5 text-udni-teal" />
<h3>Continue form</h3>
</div>
<p className="text-gray-600 text-sm">
Continue editing an existing form.
</p>
<ContinueForm />
</div>
</div>
</>
</div>
</>
);
}
21 changes: 14 additions & 7 deletions src/components/questionnaire/EditIndividual.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useContext } from 'react';
import { useContext, useEffect } from 'react';
import { useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import { AppContext } from '../../context/AppContext';
Expand All @@ -20,6 +20,12 @@ export interface IIndividualFormData {
}

export default function EditIndividual() {
useEffect(() => {
return () => {
handleSubmit(doSubmit)();
};
}, []);

const navigate = useNavigate();
const { nextUrl } = useNextUrl();

Expand Down Expand Up @@ -128,16 +134,16 @@ export default function EditIndividual() {
</div>
<div className="my-4">
<Input
type="number"
label="Age of mother at time of referral"
{...register('customFormData.motherAge')}
type="date"
label="Date of birth mother"
{...register('customFormData.motherBirthdate')}
/>
</div>
<div className="my-4">
<Input
type="number"
label="Age of father at time of referral"
{...register('customFormData.fatherAge')}
type="date"
label="Date of birth father"
{...register('customFormData.fatherBirthdate')}
/>
</div>
<div className="my-4">
Expand All @@ -153,6 +159,7 @@ export default function EditIndividual() {
'Latino',
'Middle East',
'Oceanian',
'Mixed'
].map((x) => ({ label: x, value: x }))}
/>
{errors?.customFormData?.ethnicity && (
Expand Down

0 comments on commit 328a857

Please sign in to comment.