Skip to content

Commit

Permalink
added the draft feature in the doctor's notes (#6932)
Browse files Browse the repository at this point in the history
* added the draft feature in the doctor's note section

* added the draft feature in the doctor's note section

* made the draft specific to consultation

* Update src/Components/Facility/PatientNotesSlideover.tsx

made it consultation specific

Co-authored-by: Rithvik Nishad <[email protected]>

---------

Co-authored-by: Rithvik Nishad <[email protected]>
  • Loading branch information
shramanpaul and rithviknishad authored Jan 4, 2024
1 parent f066a36 commit 15fd7fe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Components/Facility/PatientNotesSlideover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ interface PatientNotesProps {
export default function PatientNotesSlideover(props: PatientNotesProps) {
const [show, setShow] = useState(true);
const [patientActive, setPatientActive] = useState(true);
const [noteField, setNoteField] = useState("");
const [reload, setReload] = useState(false);
const [focused, setFocused] = useState(false);

Expand All @@ -37,6 +36,11 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
const { facilityId, patientId, consultationId, setShowPatientNotesPopup } =
props;

const localStorageKey = `patientNotesNoteField_${consultationId}`;
const [noteField, setNoteField] = useState(
localStorage.getItem(localStorageKey) || ""
);

const onAddNote = async () => {
const payload = {
note: noteField,
Expand Down Expand Up @@ -127,6 +131,10 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
</div>
);

useEffect(() => {
localStorage.setItem(localStorageKey, noteField);
}, [noteField, localStorageKey]);

return (
<div
className={classNames(
Expand Down

0 comments on commit 15fd7fe

Please sign in to comment.