Skip to content

Commit 25bc76c

Browse files
committed
added slotProps
1 parent 951547b commit 25bc76c

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

client/src/features/trainee-profile/education/EducationInfo.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,17 @@ const EducationInfo = () => {
5454
name="currentCohort"
5555
label="Cohort"
5656
value={editedFields?.currentCohort ?? 'No cohort assigned'}
57-
InputProps={{
58-
readOnly: isEditing ? false : true,
59-
inputMode: 'numeric',
57+
slotProps={{
58+
input: {
59+
readOnly: isEditing ? false : true,
60+
inputMode: 'numeric',
61+
},
62+
inputLabel: { shrink: true },
6063
}}
6164
inputProps={{
6265
pattern: '[0-9]*',
6366
maxLength: 3,
6467
}}
65-
InputLabelProps={{ shrink: true }}
6668
variant={isEditing ? 'outlined' : 'standard'}
6769
onChange={handleNumericChange}
6870
/>
@@ -97,8 +99,10 @@ const EducationInfo = () => {
9799
label="Quit date"
98100
type="date"
99101
value={formatDate(editedFields?.quitDate)}
100-
InputProps={{ readOnly: isEditing ? false : true }}
101-
InputLabelProps={{ shrink: true }}
102+
slotProps={{
103+
input: { readOnly: isEditing ? false : true },
104+
inputLabel: { shrink: true },
105+
}}
102106
variant={isEditing ? 'outlined' : 'standard'}
103107
onChange={handleTextChange}
104108
/>
@@ -139,8 +143,7 @@ const EducationInfo = () => {
139143
label="Graduation date"
140144
type="date"
141145
value={formatDate(editedFields?.graduationDate)}
142-
InputProps={{ readOnly: isEditing ? false : true }}
143-
InputLabelProps={{ shrink: true }}
146+
slotProps={{ input: { readOnly: isEditing ? false : true }, inputLabel: { shrink: true } }}
144147
variant={isEditing ? 'outlined' : 'standard'}
145148
onChange={handleTextChange}
146149
/>
@@ -155,15 +158,17 @@ const EducationInfo = () => {
155158
name="startCohort"
156159
label="Start cohort"
157160
value={editedFields?.startCohort || ''}
158-
InputProps={{
159-
readOnly: isEditing ? false : true,
160-
inputMode: 'numeric',
161+
slotProps={{
162+
input: {
163+
readOnly: isEditing ? false : true,
164+
inputMode: 'numeric',
165+
},
166+
inputLabel: { shrink: true },
161167
}}
162168
inputProps={{
163169
pattern: '[0-9]*',
164170
maxLength: 3,
165171
}}
166-
InputLabelProps={{ shrink: true }}
167172
variant={isEditing ? 'outlined' : 'standard'}
168173
onChange={handleNumericChange}
169174
/>
@@ -177,8 +182,7 @@ const EducationInfo = () => {
177182
label="Start date"
178183
type="date"
179184
value={formatDate(editedFields?.startDate)}
180-
InputProps={{ readOnly: isEditing ? false : true }}
181-
InputLabelProps={{ shrink: true }}
185+
slotProps={{ input: { readOnly: isEditing ? false : true }, inputLabel: { shrink: true } }}
182186
variant={isEditing ? 'outlined' : 'standard'}
183187
onChange={handleTextChange}
184188
/>
@@ -198,8 +202,7 @@ const EducationInfo = () => {
198202
label="Technical Mentor"
199203
type="text"
200204
value={editedFields?.techMentor ?? ''}
201-
InputProps={{ readOnly: isEditing ? false : true }}
202-
InputLabelProps={{ shrink: true }}
205+
slotProps={{ input: { readOnly: isEditing ? false : true }, inputLabel: { shrink: true } }}
203206
variant={isEditing ? 'outlined' : 'standard'}
204207
onChange={handleTextChange}
205208
/>
@@ -213,8 +216,7 @@ const EducationInfo = () => {
213216
label="HR Mentor"
214217
type="text"
215218
value={editedFields?.hrMentor ?? ''}
216-
InputProps={{ readOnly: isEditing ? false : true }}
217-
InputLabelProps={{ shrink: true }}
219+
slotProps={{ input: { readOnly: isEditing ? false : true }, inputLabel: { shrink: true } }}
218220
variant={isEditing ? 'outlined' : 'standard'}
219221
onChange={handleTextChange}
220222
/>
@@ -228,8 +230,7 @@ const EducationInfo = () => {
228230
label="English Mentor"
229231
type="text"
230232
value={editedFields?.englishMentor ?? ''}
231-
InputProps={{ readOnly: isEditing ? false : true }}
232-
InputLabelProps={{ shrink: true }}
233+
slotProps={{ input: { readOnly: isEditing ? false : true }, inputLabel: { shrink: true } }}
233234
variant={isEditing ? 'outlined' : 'standard'}
234235
onChange={handleTextChange}
235236
/>
@@ -250,8 +251,7 @@ const EducationInfo = () => {
250251
type="text"
251252
multiline
252253
value={editedFields?.comments || ''}
253-
InputProps={{ readOnly: isEditing ? false : true }}
254-
InputLabelProps={{ shrink: true }}
254+
slotProps={{ input: { readOnly: isEditing ? false : true }, inputLabel: { shrink: true } }}
255255
variant={isEditing ? 'outlined' : 'standard'}
256256
onChange={handleTextChange}
257257
/>

0 commit comments

Comments
 (0)