From 7f8ddcd29268d7969458614198ef9191be23075f Mon Sep 17 00:00:00 2001 From: sonika <> Date: Sun, 20 Aug 2023 19:32:45 +0530 Subject: [PATCH] second section --- src/App.css | 8 ++ src/Components/PatientForm/FormSection1.tsx | 45 +++-------- src/Components/PatientForm/FormSection2.tsx | 83 +++++++++++++++++++++ src/Components/PatientForm/PatientForm.tsx | 62 +++++++++++---- 4 files changed, 149 insertions(+), 49 deletions(-) create mode 100644 src/Components/PatientForm/FormSection2.tsx diff --git a/src/App.css b/src/App.css index a4f9208..2593164 100644 --- a/src/App.css +++ b/src/App.css @@ -7,4 +7,12 @@ .collapsable-form-style .MuiInputBase-root { width: 300px !important; margin: 5%; +} + +.textfield-padding .css-e4w4as-MuiFormLabel-root-MuiInputLabel-root{ + padding:'15px' !important; +} + +.custom-legend-padding fieldset legend { + padding: 25px !important; } \ No newline at end of file diff --git a/src/Components/PatientForm/FormSection1.tsx b/src/Components/PatientForm/FormSection1.tsx index 1a0fb60..ed8956f 100644 --- a/src/Components/PatientForm/FormSection1.tsx +++ b/src/Components/PatientForm/FormSection1.tsx @@ -67,7 +67,7 @@ export default function FormSection1(){ city: "", state: "", zipCode: "", - gender: "", + gender: "male", maritalStatus: "", }, validationSchema, @@ -88,10 +88,10 @@ export default function FormSection1(){ return( <> - + - {/* */} + + Gender } label="Male" /> } label="Female" /> + - - {/* - Marital Status - - } label="Single" /> - } label="Married" /> - - */} - - {/* - - */} ) diff --git a/src/Components/PatientForm/FormSection2.tsx b/src/Components/PatientForm/FormSection2.tsx new file mode 100644 index 0000000..09ebde0 --- /dev/null +++ b/src/Components/PatientForm/FormSection2.tsx @@ -0,0 +1,83 @@ +import * as React from 'react'; +import { Button, Checkbox, FormControl, FormControlLabel, FormGroup, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; +import { useFormik } from "formik"; +import * as yup from "yup"; +import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; + +export default function FormSection1(){ + const [state, setState] = React.useState({ + married: false, + single: false, + widowed: false, + separated: false, + divorced: false, + }); + + const handleChange = (event: React.ChangeEvent) => { + setState({ ...state, [event.target.name]: event.target.checked }); + }; + + + return( + <> + +
+ + + + Marital Status + + } label="Married" /> + } label="Single" /> + } label="Widowed" /> + } label="Seperated" /> + } label="Divorced" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + ) +} \ No newline at end of file diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 8f9aaa1..3d65d97 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -1,13 +1,18 @@ import * as React from 'react'; -import Accordion from '@mui/material/Accordion'; -import AccordionSummary from '@mui/material/AccordionSummary'; -import AccordionDetails from '@mui/material/AccordionDetails'; import Typography from '@mui/material/Typography'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import Footer from "../Footer"; import Header from "../Header"; -import { Button, FormControl, FormControlLabel, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; +import {Button, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; import FormSection1 from './FormSection1'; +import { styled } from '@mui/material/styles'; +import ArrowForwardIosSharpIcon from '@mui/icons-material/ArrowForwardIosSharp'; +import MuiAccordion, { AccordionProps } from '@mui/material/Accordion'; +import MuiAccordionSummary, { + AccordionSummaryProps, +} from '@mui/material/AccordionSummary'; +import MuiAccordionDetails from '@mui/material/AccordionDetails'; +import FormSection2 from './FormSection2'; interface Patient { fullName: string; @@ -25,6 +30,41 @@ interface Patient { maritalStatus: string; } + const Accordion = styled((props: AccordionProps) => ( + + ))(({ theme }) => ({ + border: `1px solid ${theme.palette.divider}`, + '&:not(:last-child)': { + borderBottom: 0, + }, + '&:before': { + display: 'none', + }, + })); + + const AccordionSummary = styled((props: AccordionSummaryProps) => ( + } + {...props} + /> + ))(({ theme }) => ({ + backgroundColor: + theme.palette.mode === 'dark' + ? 'rgba(255, 255, 255, .05)' + : 'rgba(0, 0, 0, .03)', + flexDirection: 'row-reverse', + '& .MuiAccordionSummary-expandIconWrapper.Mui-expanded': { + transform: 'rotate(90deg)', + }, + '& .MuiAccordionSummary-content': { + marginLeft: theme.spacing(1), + }, + })); + + const AccordionDetails = styled(MuiAccordionDetails)(({ theme }) => ({ + padding: theme.spacing(2), + borderTop: '1px solid rgba(0, 0, 0, .125)', + })); export default function PatientForm(){ const [expanded, setExpanded] = React.useState('panel1'); @@ -73,25 +113,19 @@ export default function PatientForm(){ > Basic Patient Information (Part 1) + - - } - aria-controls="panel2a-content" - id="panel2a-header" - > + + Basic Patient Information (Part 2) - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse - malesuada lacus ex, sit amet blandit leo lobortis eget. - +