Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge diffs from WF/Nirmal/develop #6

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading