diff --git a/src/components/formLayout/UpdateSymptomsDesign/SymptomsIntensityQuestion.tsx b/src/components/formLayout/UpdateSymptomsDesign/SymptomsIntensityQuestion.tsx deleted file mode 100644 index 9311c21e..00000000 --- a/src/components/formLayout/UpdateSymptomsDesign/SymptomsIntensityQuestion.tsx +++ /dev/null @@ -1,220 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { Button, Container, Typography, Box, useMediaQuery, useTheme, Paper, Grid } from '@mui/material'; -import questions from '../../../static/data/formSymptomsIntensity.json'; -import SymptomsUpdateQuestion from './SymptomsUpdateQuestion'; - -const styles = { - centered: { - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - }, -}; - -export default function SymptomsIntensity({ changeStatus, selection }: any) { - const [ansOne, setAnsOne] = useState(false); - const [ansTwo, setAnsTwo] = useState(false); - const [ansThree, setAnsThree] = useState(false); - const [value, setValue] = useState('false'); - const [error, setError] = useState(false); - const [pointValue, setPointValue] = useState(0); - const theme = useTheme(); - const midSize = useMediaQuery(theme.breakpoints.down('md')); - const matchesSm = useMediaQuery(theme.breakpoints.down('sm')); - const [symptomIntensityAnswer, setSymptomIntensityAnswer] = useState([]); - const dict: any = {}; - const [dictionaryState, setDictionaryState] = useState(); - - // eslint-disable-next-line array-callback-return - selection.map((id: any) => { - dict[id] = { Mild: false, Moderate: false, Severe: false }; - }); - console.log(dict); - setDictionaryState(dict); - console.log(dictionaryState); - - const handleClickOne = (id: any) => { - if (!dict[id].Mild) { - setError(false); - dict[id].Mild = true; - dict[id].Moderate = false; - dict[id].Severe = false; - } - console.log(dict); - if (ansOne !== true) { - setAnsOne(true); - setAnsTwo(false); - setAnsThree(false); - setError(false); - // setPointValue(questions[id].p1); - } else { - setAnsOne(false); - } - }; - - const handleClickTwo = () => { - if (ansTwo !== true) { - setAnsTwo(true); - setAnsOne(false); - setAnsThree(false); - setError(false); - // setPointValue(questions[id].p2); - } else { - setAnsTwo(false); - } - }; - - const handleClickThree = () => { - if (ansThree !== true) { - setAnsThree(true); - setAnsOne(false); - setAnsTwo(false); - setError(false); - // setPointValue(questions[id].p3); - } else { - setAnsThree(false); - } - }; - - useEffect(() => { - if (value !== 'false') { - changeStatus(value); - } - }, [changeStatus, value]); - - const handleSubmit = () => { - if (!ansOne && !ansTwo && !ansThree) { - setError(true); - } else { - setAnsOne(false); - setAnsTwo(false); - setAnsThree(false); - setValue('response'); - } - }; - - return ( -
- - - - - Indicate the severity your symptoms - - {selection.map((symptom: number) => ( - - - - - {' '} - {questions[symptom]?.label} - {' '} - - - - - - - - - - - - ))} - - - {error && ( -

Please select an option.

- )} - -
-
-
-
- ); -}