replace select by single input

This commit is contained in:
SophieMdl
2020-07-22 09:53:53 +02:00
parent 7aab7c74f6
commit 59fcfbf78d

View File

@ -7,17 +7,9 @@ import ModalEvents from '../../constants/ModalEvents';
import { getFieldProps } from '../../utils'; import { getFieldProps } from '../../utils';
import DataModal from '../DataModal'; import DataModal from '../DataModal';
const SKILL_LEVELS = [
'Fundamental Awareness',
'Novice',
'Intermediate',
'Advanced',
'Expert',
];
const initialValues = { const initialValues = {
name: '', name: '',
level: SKILL_LEVELS[0], level: '',
}; };
const SkillModal = () => { const SkillModal = () => {
@ -25,9 +17,7 @@ const SkillModal = () => {
const schema = Yup.object().shape({ const schema = Yup.object().shape({
name: Yup.string().required(t('shared.forms.validation.required')), name: Yup.string().required(t('shared.forms.validation.required')),
level: Yup.string() level: Yup.string().required(t('shared.forms.validation.required')),
.oneOf(SKILL_LEVELS)
.required(t('shared.forms.validation.required')),
}); });
return ( return (
@ -51,8 +41,7 @@ const SkillModal = () => {
<Input <Input
label={t('builder.skills.level')} label={t('builder.skills.level')}
type="dropdown" placeholder="Fundamental Awareness"
options={SKILL_LEVELS}
{...getFieldProps(formik, schema, 'level')} {...getFieldProps(formik, schema, 'level')}
/> />
</div> </div>