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

Commit

Permalink
#32 added response layout
Browse files Browse the repository at this point in the history
  • Loading branch information
samimerhi authored and MilitsaB committed Mar 16, 2022
1 parent 1d35c1a commit 3aa2dc1
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/components/UpdateFormLayout/SymptomsIntensity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ export default function SymptomsIntensity({ changeStatus, selection }: any) {
minHeight="95vh"
width="100%"
flexDirection="column"
sx={{ flexGrow: 1 }}
sx={{ flexGrow: 1, margin: 'auto' }}
style={styles.centered}
>
<Paper
sx={{
width: midSize ? '100%' : '70%',
width: midSize ? '100%' : 'auto',
padding: 4,
margin: 'auto',
}}
>
<Container
Expand All @@ -104,7 +105,7 @@ export default function SymptomsIntensity({ changeStatus, selection }: any) {
<Container
sx={{
justifyContent: 'center',
width: midSize ? '100%' : '70%',
// width: midSize ? '100%' : '70%',
margin: 0,
paddingBottom: 2,
paddingTop: 2,
Expand Down Expand Up @@ -181,7 +182,7 @@ export default function SymptomsIntensity({ changeStatus, selection }: any) {
</Container>
<Container
sx={{
marginLeft: '1rem',
// marginLeft: '1rem',
marginTop: '2rem',
flexDirection: 'column',
}}
Expand Down
42 changes: 42 additions & 0 deletions src/components/UpdateFormLayout/SymptomsUpdateResponse.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React, { useState } from 'react';
import {
Typography,
Link,
Paper,
useTheme,
useMediaQuery,
Grid,
} from '@mui/material';

export default function SymptomsUpdateResponse() {
const theme = useTheme();
const midSize = useMediaQuery(theme.breakpoints.down('md'));

return (
<Paper
sx={{
display: 'flex',
padding: 4,
justifyContent: 'center',
width: midSize ? '100%' : '50%',
margin: 'auto',
}}
>
<Grid
container
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
>
<Grid item>
<Typography variant="h5" align="center">Your symptoms have been updated.</Typography>
</Grid>
<Grid item>
<Link href="/dashboard" variant="h6" align="center">Go back to dashboard</Link>
</Grid>
</Grid>
</Paper>
);
}
2 changes: 1 addition & 1 deletion src/components/UpdateFormLayout/SymptomsUpdating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function SymptomsUpdating({ changeStatus, changeSymptoms }: any)
<Container
sx={{ display: 'flex',
justifyContent: 'center',
width: midSize ? '70%' : '50%',
width: midSize ? '100%' : '70%',
}}
>
<FormControl component="fieldset">
Expand Down
4 changes: 4 additions & 0 deletions src/components/UpdateFormLayout/UpdateSymptomsLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import SymptomsQuestion from './SymptomsUpdating';
import SymptomsIntensity from './SymptomsIntensity';
import SymptomsUpdateResponse from './SymptomsUpdateResponse';

export default function FormLayout({ changeState }: any) {
const [status, setStatus] = useState('1');
Expand All @@ -14,6 +15,9 @@ export default function FormLayout({ changeState }: any) {
case '2':
layout = <SymptomsIntensity changeStatus={setStatus} selection={symptomsArray} />;
break;
case 'response':
layout = <SymptomsUpdateResponse />;
break;
default:
layout = '';
}
Expand Down

0 comments on commit 3aa2dc1

Please sign in to comment.