Skip to content

Commit c41efaf

Browse files
committed
refactor: remove redundant if statement code
1 parent 9cbb81b commit c41efaf

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

apps/web/src/features/session/components/StartSessionForm/StartSessionForm.tsx

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -106,32 +106,28 @@ export const StartSessionForm = ({ currentGroup, initialValues, readOnly, onSubm
106106
},
107107
subjectDateOfBirth: {
108108
kind: 'dynamic',
109-
deps: ['subjectIdentificationMethod'],
110-
render({ subjectIdentificationMethod }) {
111-
return subjectIdentificationMethod === 'PERSONAL_INFO' || subjectIdentificationMethod === 'CUSTOM_ID'
112-
? {
113-
kind: 'date',
114-
label: t('core.identificationData.dateOfBirth.label')
115-
}
116-
: null;
109+
deps: [],
110+
render() {
111+
return {
112+
kind: 'date',
113+
label: t('core.identificationData.dateOfBirth.label')
114+
};
117115
}
118116
},
119117
subjectSex: {
120118
kind: 'dynamic',
121-
deps: ['subjectIdentificationMethod'],
122-
render({ subjectIdentificationMethod }) {
123-
return subjectIdentificationMethod === 'PERSONAL_INFO' || subjectIdentificationMethod === 'CUSTOM_ID'
124-
? {
125-
description: t('core.identificationData.sex.description'),
126-
kind: 'string',
127-
label: t('core.identificationData.sex.label'),
128-
options: {
129-
FEMALE: t('core.identificationData.sex.female'),
130-
MALE: t('core.identificationData.sex.male')
131-
},
132-
variant: 'select'
133-
}
134-
: null;
119+
deps: [],
120+
render() {
121+
return {
122+
description: t('core.identificationData.sex.description'),
123+
kind: 'string',
124+
label: t('core.identificationData.sex.label'),
125+
options: {
126+
FEMALE: t('core.identificationData.sex.female'),
127+
MALE: t('core.identificationData.sex.male')
128+
},
129+
variant: 'select'
130+
};
135131
}
136132
}
137133
}

0 commit comments

Comments
 (0)