Skip to content

Commit

Permalink
revert formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jona42-ui committed Nov 15, 2023
1 parent 121e13e commit 952e825
Show file tree
Hide file tree
Showing 3 changed files with 491 additions and 489 deletions.
42 changes: 22 additions & 20 deletions frontend/src/components/patient/CreatePatientForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,26 @@ function CreatePatientForm(props) {
}));
};

function handleYearsChange(e) {
function handleYearsChange(e, values) {
setPatientDetails(values);
let years = e.target.value;
setDateOfBirthFormatter({
...dateOfBirthFormatter,
years: years,
});
}

function handleMonthsChange(e) {
function handleMonthsChange(e, values) {
setPatientDetails(values);
let months = e.target.value;
setDateOfBirthFormatter({
...dateOfBirthFormatter,
months: months,
});
}

function handleDaysChange(e) {
function handleDaysChange(e, values) {
setPatientDetails(values);
let days = e.target.value;
setDateOfBirthFormatter({
...dateOfBirthFormatter,
Expand Down Expand Up @@ -380,7 +383,7 @@ function CreatePatientForm(props) {
</Field>
</div>
<Accordion>
<AccordionItem title="Emergency Contact Information">
<AccordionItem title={intl.formatMessage({ id: "emergencyContactInfo.title" })}>
<div className="inlineDiv">
<Field name="patientContact.person.lastName">
{({ field }) => (
Expand Down Expand Up @@ -492,18 +495,10 @@ function CreatePatientForm(props) {
className="inputText"
id="create_patient_gender"
>
<RadioButton
id="radio-1"
labelText={intl.formatMessage({ id: "patient.male" })}
value="M"
/>
<RadioButton
id="radio-2"
labelText={intl.formatMessage({
<RadioButton id="radio-1" labelText={intl.formatMessage({ id: "patient.male" })} value="M" />
<RadioButton id="radio-2" labelText={intl.formatMessage({
id: "patient.female",
})}
value="F"
/>
})} value="F" />
</RadioButtonGroup>
)}
</Field>
Expand All @@ -523,7 +518,9 @@ function CreatePatientForm(props) {
<DatePickerInput
id="date-picker-default-id"
placeholder="dd/mm/yyyy"
labelText={intl.formatMessage({ id: "patient.dob" })}
labelText={intl.formatMessage({
id: "patient.female",
})}
type="text"
name={field.name}
/>
Expand All @@ -534,25 +531,30 @@ function CreatePatientForm(props) {
<TextInput
value={dateOfBirthFormatter.years}
name="years"
labelText={intl.formatMessage({ id: "patient.age.years" })}
labelText={intl.formatMessage({
id: "patient.female",
})}
id="years"
onChange={handleYearsChange}
type="number"
onChange={(e) => handleYearsChange(e, values)}
className="inputText"
/>

<TextInput
value={dateOfBirthFormatter.months}
name="months"
labelText={intl.formatMessage({ id: "patient.age.months" })}
onChange={handleMonthsChange}
type="number"
onChange={(e) => handleMonthsChange(e, values)}
id="months"
className="inputText"
/>

<TextInput
value={dateOfBirthFormatter.days}
name="days"
onChange={handleDaysChange}
type="number"
onChange={(e) => handleDaysChange(e, values)}
labelText={intl.formatMessage({ id: "patient.age.days" })}
id="days"
className="inputText"
Expand Down
Loading

0 comments on commit 952e825

Please sign in to comment.