Skip to content

Commit

Permalink
Merge branch 'main' of github.com:DIPSAS/hello-open-dips
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiejoha committed Jun 26, 2024
2 parents 57f5a4f + 26d7938 commit 7c8530b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
31 changes: 14 additions & 17 deletions src/pages/searchPatient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,25 @@ import { useRouter } from 'next/router'
import styles from '../styles/searchPatient.module.scss';
import Link from "next/link";

import { R4 } from "@ahryman40k/ts-fhir-types";


const ChoosePatient: React.FC<{ clientLoading: boolean }> = ({ clientLoading }) => {
const [patientId, setPatientId] = useState<string>("");
const { client } = useContext(clientContext);
const navigate = useRouter();
const [loading, setLoading] = useState<boolean>(false);


const renderEverything = (id: string) =>
{
navigate.push(`/patient/${id}`);
}


// Search for active patient if any patient is active
useEffect(() => {
if (client?.patient?.id) {
navigate.push(`/patient/${client.patient.id}`);
}
}, [client, navigate]);


// Search for patient on pressed enter key
const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
if (event.key === 'Enter') {
renderEverything(patientId)
navigate.push(`/patient/${patientId}`);
}
};

Expand All @@ -46,11 +40,11 @@ const ChoosePatient: React.FC<{ clientLoading: boolean }> = ({ clientLoading })
onKeyDown={(e) => handleKeyDown(e)}
/>
</div>
<Link href={{ pathname: `/patient/${patientId}`}} className="default-link">
<button className={styles.dipsPrimaryButton} >
Submit
</button>
</Link>
<Link href={{ pathname: `/patient/${patientId}`}} className="default-link">
<button className={styles.dipsPrimaryButton} >
Submit
</button>
</Link>
</div>
</div>
);
Expand All @@ -61,8 +55,11 @@ const ChoosePatient: React.FC<{ clientLoading: boolean }> = ({ clientLoading })
<div className="text-wrapper">
<p>Missing access!</p>
<p>Please restart the app and allow access to all resources.</p>
<button className="dipsPrimaryButton">
</button>
<Link href={{ pathname: `/`}} className="default-link">
<button className={styles.dipsPrimaryButton} >
Re-authenticate
</button>
</Link>
</div>
</div>
);
Expand Down
2 changes: 0 additions & 2 deletions src/styles/conditions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@
}

.conditions-list {
// max-height: 10%;
padding: 0;
margin: 0;
list-style-type: none;

// height: 90%;

overflow-y: scroll;
scrollbar-width: thin;
Expand Down
11 changes: 7 additions & 4 deletions src/styles/searchPatient.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
border-color: $dips-dark-blue;
border-style: solid;
border-width: 2px;
background-color: white;
}

.inputLabel {
Expand All @@ -29,17 +30,19 @@
color: #262626;
width: 300px;
height: 40px;
border: 1px solid #b6b7b9;
border: 1px solid $neutral-black;
border-radius: 0.50rem;
outline: none;
font-size: 18px;
font-family: 'CircularStd';
margin-bottom: 40px;
margin-top: 15px;
}
background-color: whitesmoke;

.inputField input:focus {
border-color: $dips-primary-blue;
&:focus {
background-color: white;
border: 1px solid $dips-primary-blue;
}
}

.dipsPrimaryButton {
Expand Down

0 comments on commit 7c8530b

Please sign in to comment.