diff --git a/src/pages/PartnerAddRequest/PartnerAddRequest.jsx b/src/pages/PartnerAddRequest/PartnerAddRequest.jsx index dbc2bdae..14199b95 100644 --- a/src/pages/PartnerAddRequest/PartnerAddRequest.jsx +++ b/src/pages/PartnerAddRequest/PartnerAddRequest.jsx @@ -34,17 +34,20 @@ export const PartnerAddRequest = () => { const [specializationList, setSpecializationList] = useState([]); const [levelList, setLevelList] = useState([]); const [countList] = useState([1, 2, 3, 4, 5]); + const [locationList] = useState(['РФ', 'Беларусь']); const [openSkillsSelect, setOpenSkillsSelect] = useState(false); const [openSpecializationList, setOpenSpecializationListOpen] = useState(false); const [openLevelList, setOpenLevelList] = useState(false); const [openCountList, setOpenCountList] = useState(false); + const [openLocationList, setOpenLocationList] = useState(false); const [editRequest, setEditRequest] = useState(false); const [selectedSkills, setSelectedSkills] = useState([]); const [selectedSpecialization, setSelectedSpecialization] = useState( "Выберите специализацию" ); const [selectedLevel, setSelectedLevel] = useState("Выберите уровень"); + const [selectedLocation, setSelectedLocation] = useState("Выберите локацию"); const [selectedCount, setSelectedCount] = useState( "Выберите кол-во сотрудников" ); @@ -177,6 +180,7 @@ export const PartnerAddRequest = () => { setOpenSpecializationListOpen(false); setOpenLevelList(false); setOpenCountList(false); + setOpenLocationList(false); } }; @@ -202,280 +206,328 @@ export const PartnerAddRequest = () => { ? "Страница редактирования заявки" : "Страница добавления заявки"} -
-
-
-

Данные открытой позиции

-
-

Название вакансии

-
- - setInputs((prevValue) => ({ - ...prevValue, - title: e.target.value - })) - } - type="text" - placeholder="Вакансия" - /> -
-
-
-

Выберите специализацию

-
{ - setOpenSpecializationListOpen(!openSpecializationList); - }} - > -
- - {typeof selectedSpecialization === "string" - ? selectedSpecialization - : selectedSpecialization.name} - - +
+
+
+

Данные открытой позиции

+
+

Название вакансии

+
+ + setInputs((prevValue) => ({ + ...prevValue, + title: e.target.value + })) + } + type="text" + placeholder="Вакансия" />
- {openSpecializationList && - Boolean(specializationList.length) && ( -
- {specializationList.map((specialization) => { +
+

Выберите специализацию

+
{ + setOpenSpecializationListOpen(!openSpecializationList); + }} + > +
+ + {typeof selectedSpecialization === "string" + ? selectedSpecialization + : selectedSpecialization.name} + + +
+
+ {openSpecializationList && + Boolean(specializationList.length) && ( +
+ {specializationList.map((specialization) => { + return ( +

{ + setOpenSpecializationListOpen(false); + setSelectedSpecialization(specialization); + }} + > + {specialization.name} +

+ ); + })} +
+ )} +
+
+

Навыки

+
{ + setOpenSkillsSelect(true); + }} + > + {Boolean(selectedSkills.length) && + selectedSkills.map((skill, index) => { return ( -

+ {skill.name} + delete { + setSkills((prevArray) => [...prevArray, skill]); + setFilteredSkills((prevArray) => [ + ...prevArray, + skill + ]); + setSelectedSkills( + selectedSkills.filter((skill, indexSkill) => { + return indexSkill !== index; + }) + ); + }} + /> +

+ ); + })} + { + setFilteredSkills( + skills.filter((skill) => { + return skill.name + .toLowerCase() + .includes(e.target.value.toLowerCase()); + }) + ); + }} + /> +
+ {openSkillsSelect && Boolean(filteredSkills.length) && ( +
+ {filteredSkills.map((skill, index) => { + return ( + { - setOpenSpecializationListOpen(false); - setSelectedSpecialization(specialization); + setSelectedSkills((prevArray) => [ + ...prevArray, + skill + ]); + setFilteredSkills( + filteredSkills.filter((skill, skillIndex) => { + return skillIndex !== index; + }) + ); + setSkills( + skills.filter((initSkill) => { + return initSkill.id !== skill.id; + }) + ); + setOpenSkillsSelect(false); }} > - {specialization.name} + {skill.name} + + ); + })} +
+ )} +
+
+
+

Квалификация

+
+

Выберите уровень знаний

+
setOpenLevelList(!openLevelList)} + > + + {typeof selectedLevel === "string" + ? selectedLevel + : selectedLevel.name} + + +
+ {openLevelList && Boolean(Object.values(levelList).length) && ( +
+ {Object.values(levelList).map((level, index) => { + return ( +

{ + setOpenLevelList(false); + setSelectedLevel({ name: level, id: index + 1 }); + }} + > + {level}

); })}
)} -
-
-

Навыки

-
{ - setOpenSkillsSelect(true); - }} - > - {Boolean(selectedSkills.length) && - selectedSkills.map((skill, index) => { - return ( -
- {skill.name} - delete { - setSkills((prevArray) => [...prevArray, skill]); - setFilteredSkills((prevArray) => [ - ...prevArray, - skill - ]); - setSelectedSkills( - selectedSkills.filter((skill, indexSkill) => { - return indexSkill !== index; - }) - ); - }} - /> -
- ); - })} - { - setFilteredSkills( - skills.filter((skill) => { - return skill.name - .toLowerCase() - .includes(e.target.value.toLowerCase()); - }) - ); - }} +
+
+

Введите необходимое описание

+