|
1 | 1 | /* eslint-disable complexity */ |
2 | 2 | import { Dispatch, FC, MutableRefObject, SetStateAction, useRef, useState } from 'react' |
3 | | -import { bind, trim } from 'lodash' |
| 3 | +import { bind, sortBy, trim } from 'lodash' |
4 | 4 | import { toast } from 'react-toastify' |
5 | 5 | import classNames from 'classnames' |
6 | 6 |
|
7 | | -import { BaseModal, Button, IconOutline, InputDatePicker, InputText } from '~/libs/ui' |
| 7 | +import { BaseModal, Button, IconOutline, InputDatePicker, InputSelect, InputText } from '~/libs/ui' |
8 | 8 | import { |
9 | 9 | createMemberTraitsAsync, |
10 | 10 | updateMemberTraitsAsync, |
11 | 11 | UserProfile, UserTrait, |
12 | 12 | UserTraitCategoryNames, |
13 | 13 | UserTraitIds, |
14 | 14 | } from '~/libs/core' |
| 15 | +import { INDUSTRIES_OPTIONS } from '~/libs/shared' |
15 | 16 |
|
16 | 17 | import { WorkExpirenceCard } from '../WorkExpirenceCard' |
17 | 18 |
|
@@ -61,6 +62,12 @@ const ModifyWorkExpirenceModal: FC<ModifyWorkExpirenceModalProps> = (props: Modi |
61 | 62 | ] |
62 | 63 | = useState<UserTrait[] | undefined>(props.workExpirence) |
63 | 64 |
|
| 65 | + const industryOptions: any = sortBy(INDUSTRIES_OPTIONS) |
| 66 | + .map(v => ({ |
| 67 | + label: v, |
| 68 | + value: v, |
| 69 | + })) |
| 70 | + |
64 | 71 | function handleModifyWorkExpirenceSave(): void { |
65 | 72 | if (addingNewItem || editedItemIndex !== undefined) { |
66 | 73 | handleFormAction() |
@@ -307,30 +314,17 @@ const ModifyWorkExpirenceModal: FC<ModifyWorkExpirenceModalProps> = (props: Modi |
307 | 314 | onChange={bind(handleFormValueChange, this, 'position')} |
308 | 315 | value={formValues.position as string} |
309 | 316 | /> |
310 | | - <div className={styles.row}> |
311 | | - <InputText |
312 | | - name='industry' |
313 | | - label='Industry' |
314 | | - error={formErrors.industry} |
315 | | - placeholder='Enter an industry' |
316 | | - dirty |
317 | | - tabIndex={0} |
318 | | - type='text' |
319 | | - onChange={bind(handleFormValueChange, this, 'industry')} |
320 | | - value={formValues.industry as string} |
321 | | - /> |
322 | | - <InputText |
323 | | - name='city' |
324 | | - label='City' |
325 | | - error={formErrors.city} |
326 | | - placeholder='Enter a city' |
327 | | - dirty |
328 | | - tabIndex={0} |
329 | | - type='text' |
330 | | - onChange={bind(handleFormValueChange, this, 'city')} |
331 | | - value={formValues.city as string} |
332 | | - /> |
333 | | - </div> |
| 317 | + <InputSelect |
| 318 | + tabIndex={0} |
| 319 | + options={industryOptions} |
| 320 | + value={formValues.industry as string} |
| 321 | + onChange={bind(handleFormValueChange, this, 'industry')} |
| 322 | + name='industry' |
| 323 | + label='Industry' |
| 324 | + placeholder='Select industry' |
| 325 | + dirty |
| 326 | + error={formErrors.industry} |
| 327 | + /> |
334 | 328 | <div className={styles.row}> |
335 | 329 | <InputDatePicker |
336 | 330 | label='Start Date' |
|
0 commit comments