feature/view-patient-data #7

Merged
vipeesh.p merged 14 commits from feature/view-patient-data into develop 2023-09-14 11:01:38 +00:00
2 changed files with 37 additions and 31 deletions
Showing only changes of commit 60c1152a38 - Show all commits

View File

@ -11,10 +11,12 @@ type Props = {
const EntryForm = ({ entries, onUpdate, onDelete, onSave }: Props) => {
return (
<div className='entryForm'>
<span className='header'>*** Mark Your Areas of Pain on the Picture ***</span>
{entries && entries.length > 0 &&
<span className='header'>
*** Mark Your Areas of Pain on the Picture ***
</span>
{entries && entries.length > 0 && (
<span className='sub-header'>How much pain are you in right now?</span>
}
)}
{entries?.map((entry: any, index: number) => (
<Entry
entry={entry}
@ -24,14 +26,14 @@ const EntryForm = ({ entries, onUpdate, onDelete, onSave }: Props) => {
onDelete={onDelete}
/>
))}
{
{/* {
entries && entries.length > 0 &&
<div className='buttonDiv'>
<Button variant='contained' onClick={() => onSave({})}>
Save
</Button>
</div>
}
} */}
</div>
);
};

View File

@ -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<Array<Marker>>([]);
@ -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 (
<div className='image-marker-div'>
<div className='entry-div'>
<EntryForm
entries={entries}
onSave={onSave}
onDelete={deleteEntry}
onUpdate={updateEntry}
/>
</div>
<div className='marker-div'>
<ImageMarker
src={humanImage}
markers={markers}
onAddMarker={(marker: Marker) => addEntries(marker)}
/>
</div>
</div>
)
}
export default PatientImageMarker;
useEffect(() => {
onSave();
}, [entries]);
return (
<div className='image-marker-div'>
<div className='entry-div'>
<EntryForm
entries={entries}
onSave={onSave}
onDelete={deleteEntry}
onUpdate={updateEntry}
/>
</div>
<div className='marker-div'>
<ImageMarker
src={humanImage}
markers={markers}
onAddMarker={(marker: Marker) => addEntries(marker)}
/>
</div>
</div>
);
};
export default PatientImageMarker;