diff --git a/src/Components/ImageMarker/EntryForm.tsx b/src/Components/ImageMarker/EntryForm.tsx
index 06e92c8..cde8697 100644
--- a/src/Components/ImageMarker/EntryForm.tsx
+++ b/src/Components/ImageMarker/EntryForm.tsx
@@ -11,10 +11,12 @@ type Props = {
const EntryForm = ({ entries, onUpdate, onDelete, onSave }: Props) => {
return (
-
*** Mark Your Areas of Pain on the Picture ***
- {entries && entries.length > 0 &&
+
+ *** Mark Your Areas of Pain on the Picture ***
+
+ {entries && entries.length > 0 && (
How much pain are you in right now?
- }
+ )}
{entries?.map((entry: any, index: number) => (
{
onDelete={onDelete}
/>
))}
- {
+ {/* {
entries && entries.length > 0 &&
onSave({})}>
Save
- }
+ } */}
);
};
diff --git a/src/Components/ImageMarker/PatientImageMarker.tsx b/src/Components/ImageMarker/PatientImageMarker.tsx
index 1ac39be..5537bdd 100644
--- a/src/Components/ImageMarker/PatientImageMarker.tsx
+++ b/src/Components/ImageMarker/PatientImageMarker.tsx
@@ -1,12 +1,12 @@
-import React, { useEffect, useState } from 'react'
+import React, { useEffect, useState } from 'react';
import ImageMarker, { Marker } from 'react-image-marker';
import humanImage from '../../Assets/human_body_3d.jpg';
import EntryForm from './EntryForm';
-import './PatientImageMarker.css'
+import './PatientImageMarker.css';
-type Props = {}
+type Props = {};
const PatientImageMarker = (props: Props) => {
const [markers, setMarkers] = useState>([]);
@@ -38,7 +38,7 @@ const PatientImageMarker = (props: Props) => {
'entry',
JSON.stringify({ markers: markers, entries: entries })
);
- }
+ };
useEffect(() => {
if (action.type === 'add')
@@ -48,26 +48,30 @@ const PatientImageMarker = (props: Props) => {
entries.filter((entry: any, ind: number) => ind != action.index)
);
}, [action]);
-
- return (
-
-
-
-
-
- addEntries(marker)}
- />
-
-
- )
-}
-export default PatientImageMarker;
\ No newline at end of file
+ useEffect(() => {
+ onSave();
+ }, [entries]);
+
+ return (
+
+
+
+
+
+ addEntries(marker)}
+ />
+
+
+ );
+};
+
+export default PatientImageMarker;