Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vasharma05 authored Jul 11, 2023
1 parent e8a19b0 commit 25f8f0d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export const DobField: React.FC = () => {
fieldConfigurations: { dateOfBirth },
} = useConfig<RegistrationConfig>();
const allowEstimatedBirthDate = dateOfBirth?.allowEstimatedDateOfBirth;
const [dobUnknown] = useField('birthdateEstimated');
const dobKnown = !dobUnknown.value;
const [field: {value: dobUnknown}] = useField('birthdateEstimated');
const [birthdate, birthdateMeta] = useField('birthdate');
const [yearsEstimated, yearsEstimateMeta] = useField('yearsEstimated');
const [monthsEstimated, monthsEstimateMeta] = useField('monthsEstimated');
Expand Down Expand Up @@ -76,12 +75,12 @@ export const DobField: React.FC = () => {
return (
<div className={styles.halfWidthInDesktopView}>
<h4 className={styles.productiveHeading02Light}>{t('birthFieldLabelText', 'Birth')}</h4>
{(allowEstimatedBirthDate || !dobKnown) && (
{(allowEstimatedBirthDate || dobUnknown) && (
<div className={styles.dobField}>
<div className={styles.dobContentSwitcherLabel}>
<span className={styles.label01}>{t('dobToggleLabelText', 'Date of Birth Known?')}</span>
</div>
<ContentSwitcher onChange={onToggle} selectedIndex={dobKnown ? 0 : 1}>
<ContentSwitcher onChange={onToggle} selectedIndex={dobUnknown ? 1 : 0}>
<Switch name="known" text={t('yes', 'Yes')} />
<Switch name="unknown" text={t('no', 'No')} />
</ContentSwitcher>
Expand Down

0 comments on commit 25f8f0d

Please sign in to comment.