Skip to content

Commit

Permalink
Revert "Replace RHFOptionCardGroup with MultiSelectTiles"
Browse files Browse the repository at this point in the history
This reverts commit e296135.
  • Loading branch information
ivonne-hernandez committed Dec 18, 2024
1 parent f2ec96a commit 58e118a
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/Components/Steps/HouseholdMembers/HouseholdMemberForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import AddIcon from '@mui/icons-material/Add';
import { createMenuItems } from '../SelectHelperFunctions/SelectHelperFunctions';
import CloseButton from '../../CloseButton/CloseButton';
import { renderBirthMonthHelperText, renderBirthYearHelperText, renderHealthInsuranceHelperText, renderRelationshipToHHHelperText, renderIncomeFrequencyHelperText, renderHoursWorkedHelperText, renderIncomeAmountHelperText } from './HelperTextFunctions';
import MultiSelectTiles from '../../OptionCardGroup/MultiSelectTiles';
import './PersonIncomeBlock.css';

const HouseholdMemberForm = () => {
Expand Down Expand Up @@ -355,24 +354,18 @@ const HouseholdMemberForm = () => {
};

const displayHealthInsuranceBlock = (pageNumber: number, healthInsuranceOptions: any) => {
const indexBasedHIOptions = pageNumber === 1 ? healthInsuranceOptions.you : healthInsuranceOptions.them;
return (
<Box className="section-container">
<Stack sx={{ padding: '3rem 0' }} className="section">
{displayHealthCareQuestion(pageNumber)}
<MultiSelectTiles
values={watch('healthInsurance')}
onChange={(values) => {
setValue('healthInsurance', values, { shouldValidate: true, shouldDirty: true });
trigger('healthInsurance');
}}
options={Object.entries(indexBasedHIOptions).map(([value, content]) => {
return { value: value, text: content.text, icon: content.icon };
})}
<RHFOptionCardGroup
fields={watch('healthInsurance')}
setValue={setValue}
name="healthInsurance"
options={pageNumber === 1 ? healthInsuranceOptions.you : healthInsuranceOptions.them}
triggerValidation={trigger}
/>
{errors.healthInsurance !== undefined && (
<FormHelperText sx={{ marginLeft: 0 }}>{renderHealthInsuranceHelperText()}</FormHelperText>
)}
{errors.healthInsurance !== undefined && <FormHelperText sx={{ marginLeft: 0 }}>{renderHealthInsuranceHelperText()}</FormHelperText>}
</Stack>
</Box>
);
Expand Down

0 comments on commit 58e118a

Please sign in to comment.