Skip to content

Commit

Permalink
chore: Resolve merge conflicts with updated form
Browse files Browse the repository at this point in the history
  • Loading branch information
ezrajames committed Jul 18, 2022
2 parents a17c907 + 2474017 commit 2be5516
Showing 1 changed file with 51 additions and 26 deletions.
77 changes: 51 additions & 26 deletions app/web/pages/forms/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,73 @@ import { MobileDatePicker } from '@mui/x-date-pickers/MobileDatePicker';
import { LocalizationProvider } from '@mui/x-date-pickers';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';


import useAuth, { ProtectedRoute } from '../../contexts/auth';
import { ProtectedRoute } from '../../contexts/auth';
import ProtectedNavbar from "../../components/protected_navbar";


function SMFPEForm() {
const [value, setValue] = React.useState(new Date());
const [arrivalTime, setArrivalTime] = React.useState(new Date());
const [departureTime, setDepartureTime] = React.useState(new Date());

const handleChange = (newValue) => {
setValue(newValue);
};

const handleArrivalTimeChange = (newValue) => {
setArrivalTime(newValue);
};

const handleDepartureTimeChange = (newValue) => {
setDepartureTime(newValue);
};

return (
<>
<ProtectedNavbar/>
<Container maxWidth="sm">
<Grid item xs={8}>
<h2>
<Link href="/">
<a>Shambala Music Festival Patient Encounter Form</a>
</Link>
</h2>
</Grid>
<FormGroup action="/send-data-here" method="post">
<Grid container spacing={2}>
<Grid container spacing={2} style={{padding: 1 + 'rem'}}>
<Grid item xs={12}>
<h2>
<Link href="/">
<a>Music Festival Patient Encounter Form</a>
</Link>
</h2>
</Grid>
<Grid item xs={6}>
<InputLabel>Patient RFID: </InputLabel>
<TextField id="patient-rfid" label="Wristband RFID" variant="outlined" />
</Grid>
<Grid item xs={6}>
<InputLabel>Document #: </InputLabel>
<TextField id="document-number" label="eg. 1000" variant="outlined" />
</Grid>
<Grid item xs={6}>
<InputLabel id="location-select-label">Location</InputLabel>
<Select
labelId="location-select-label"
id="location-select"
defaultValue="Main Medical"
label="Location"
disabled
required
onChange={handleChange}>
<MenuItem value="Main Medical">Main Medical</MenuItem>
</Select>
</Grid>
<Grid item xs={6}>
<InputLabel>Handover From: </InputLabel>
<TextField id="handover-from" label="Who brought the patient" variant="outlined" required />
</Grid>
<Grid item xs={6}>
<LocalizationProvider dateAdapter={AdapterDateFns}>
<InputLabel>Date: </InputLabel>
<MobileDatePicker
inputFormat="MM/dd/yyyy"
required
value={value}
onChange={handleChange}
value={arrivalTime}
onChange={handleArrivalTimeChange}
renderInput={(params) => <TextField {...params} />}
/>
</LocalizationProvider>
Expand All @@ -61,8 +84,8 @@ function SMFPEForm() {
<TimePicker
required
ampm={false}
value={value}
onChange={handleChange}
value={arrivalTime}
onChange={handleArrivalTimeChange}
renderInput={(params) => <TextField {...params} />}
/>
</LocalizationProvider>
Expand All @@ -81,16 +104,14 @@ function SMFPEForm() {
</RadioGroup>
</Grid>
<Grid item xs={12}>
<InputLabel>Patient Occupation: </InputLabel>
<InputLabel>Is the patient a worker who is on shift: </InputLabel>
<RadioGroup
aria-labelledby="patient-Occupation"
name="radio-buttons-group"
name="checkbox-group"
row
required>
<FormControlLabel value="event-staff" control={<Radio />} label="Event Staff" />
<FormControlLabel value="performer" control={<Radio />} label="Performer" />
<FormControlLabel value="spectator" control={<Radio />} label="Spectator" />
<FormControlLabel value="unknown" control={<Radio />} label="Unknown" />
<FormControlLabel value="staff-yes" control={<Radio />} label="Yes" />
<FormControlLabel value="staff-no" control={<Radio />} label="No" />
</RadioGroup>
</Grid>
<Grid item xs={12}>
Expand Down Expand Up @@ -124,12 +145,12 @@ function SMFPEForm() {
<FormControlLabel value="med-transport" control={<Radio />} label="Medical Transport" />
<FormControlLabel value="security" control={<Radio />} label="Brought by Security" />
<FormControlLabel value="harm-reduction" control={<Radio />} label="Brought by Harm Reduction" />
<FormControlLabel value="other" control={<Radio />} label="other"/>
<FormControlLabel value="other" control={<Radio />} label="Other"/>
</RadioGroup>
</Grid>
<Grid item xs={6}>
<InputLabel>Handover From: </InputLabel>
<TextField id="handover-from" label="Please enter your name" variant="outlined" required />
<InputLabel>Handover To: </InputLabel>
<TextField id="handover-to" label="Patient is going with..." variant="outlined" />
</Grid>
<br/>
<Grid item xs={6}>
Expand All @@ -138,8 +159,8 @@ function SMFPEForm() {
<TimePicker
required
ampm={false}
value={value}
onChange={handleChange}
value={departureTime}
onChange={handleDepartureTimeChange}
renderInput={(params) => <TextField {...params} />}
/>
</LocalizationProvider>
Expand All @@ -161,7 +182,11 @@ function SMFPEForm() {
</RadioGroup>
</Grid>
<Grid item xs={12}>
<Button fullWidth variant="contained">Submit</Button>
<InputLabel>Comments: </InputLabel>
<TextField id="comments" label="enter comments here..." variant="outlined" fullWidth />
</Grid>
<Grid item xs={12}>
<Button fullWidth="true" variant="contained">Submit</Button>
</Grid>
</Grid>
</FormGroup>
Expand Down

0 comments on commit 2be5516

Please sign in to comment.