Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
#32 Added Update form logic and stored data in firebase
Browse files Browse the repository at this point in the history
  • Loading branch information
MilitsaB committed Mar 17, 2022
1 parent 494d1d4 commit 2365113
Show file tree
Hide file tree
Showing 13 changed files with 405 additions and 277 deletions.
42 changes: 0 additions & 42 deletions src/components/UpdateFormLayout/SymptomsUpdateResponse.tsx

This file was deleted.

159 changes: 0 additions & 159 deletions src/components/UpdateFormLayout/SymptomsUpdating.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions src/components/UpdateFormLayout/UpdateSymptomsLayout.tsx

This file was deleted.

9 changes: 7 additions & 2 deletions src/components/dashboard/PatientDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import UpdateTestResult from './patienttestresult';
import theme from '../../static/style/theme';
import { firestore } from '../../config/firebase_config';

import UpdateSymptomsLayout from '../UpdateFormLayout/UpdateSymptomsLayout';

const style = {
position: 'absolute' as const,
top: '50%',
Expand Down Expand Up @@ -115,9 +113,16 @@ function PatientDashboard() {
<Button variant="contained" color="info" sx={{ mr: 1 }} onClick={handleTestOpen}>
Add Covid-19 Test
</Button>
{!user?.assignedDoctor && (
<Button variant="contained" color="primary" onClick={() => { navigate('/symptomsForm'); }}>
Ask for Help
</Button>
)}
{user?.assignedDoctor && (
<Button variant="contained" color="primary" onClick={() => { navigate('/symptomsUpdate'); }}>
Update Your Symptoms
</Button>
)}
</Header>
<SideBar>
<List>
Expand Down
36 changes: 30 additions & 6 deletions src/components/formLayout/DrawerSymptoms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {

const drawerWidth = 350;

export default function DrawerSymptoms({ id }: any) {
export default function DrawerSymptoms({ id, content }: any) {
const navigate = useNavigate();
return (
<Box sx={{ display: 'flex' }}>
Expand Down Expand Up @@ -51,6 +51,7 @@ export default function DrawerSymptoms({ id }: any) {
</Button>
</Container>
<Container>
{content === 'symptomsForm' && (
<Typography
variant="h4"
sx={{
Expand All @@ -60,17 +61,40 @@ export default function DrawerSymptoms({ id }: any) {
>
Covid-19 Assessment Test
{id === '1' && (
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Answer a few quick questions to get a recommendation on what to do
next!
</Typography>
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Answer a few quick questions to get a recommendation on what to do
next!
</Typography>
)}
{id === '2' && (
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Follow our recommendation!
</Typography>
)}
</Typography>
)}
{content === 'updateForm' && (
<Typography
variant="h4"
sx={{
color: '#ffff',
paddingTop: 1,
}}
>
Update Your Symptoms
{id === '1' && (
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Follow our recommendation!
Answer the following questions about your symptoms.
This will allow your doctor to get a better understanding of your situation.
</Typography>
)}
{id === '2' && (
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Your symptoms have been successfully updated.
</Typography>
)}
</Typography>
)}
</Container>
<Container>
<Button
Expand Down
36 changes: 25 additions & 11 deletions src/components/formLayout/HeaderSymptoms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
CssBaseline,
} from '@mui/material';

export default function HeaderSymptoms({ id }: any) {
export default function HeaderSymptoms({ id, content }: any) {
console.log(content);
const navigate = useNavigate();
return (
<Box sx={{ flexGrow: 1 }}>
Expand Down Expand Up @@ -38,25 +39,38 @@ export default function HeaderSymptoms({ id }: any) {
{' '}
of 2
</Button>
{content === 'symptomsForm' && (
<Typography variant="h5" sx={{ marginRight: '3rem', marginTop: 1 }}>
Covid-19 Assessment Test
{id === '1' && (
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Answer a few quick questions to get a recommendation on what to do
next!
</Typography>
)}
{id === '2' && (
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Follow our recommendation!
</Typography>
)}
</Typography>
)}
{content === 'updateForm' && (
<Typography variant="h5" sx={{ marginRight: '3rem', marginTop: 1 }}>
Update Your Symptoms
{id === '1' && (
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Answer a few quick questions to get a recommendation on what to do
next!
</Typography>
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Answer the following questions about your symptoms.
This will allow your doctor to get a better understanding of your situation.
</Typography>
)}
{id === '2' && (
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Follow our recommendation!
</Typography>
)}
{id === '3' && (
<Typography sx={{ fontSize: '1rem', color: '#ffff' }}>
Update your symptoms
Your symptoms have been successfully updated.
</Typography>
)}
</Typography>
)}
</Container>
<Button
variant="contained"
Expand Down
Loading

0 comments on commit 2365113

Please sign in to comment.