diff --git a/src/components/Description/Description.js b/src/components/Description/Description.js
index 929495ee..8b9c214a 100644
--- a/src/components/Description/Description.js
+++ b/src/components/Description/Description.js
@@ -7,8 +7,9 @@ import { LEVELS, SKILLS } from '../constants/constants';
import { selectProfiles, selectFilteredCandidates, selectItems } from '../../redux/outstaffingSlice';
import { useSelector } from 'react-redux';
import { fetchProfile } from '../../server/server';
+import { Loader } from '../Loader/Loader';
-const Description = ({ onLoadMore }) => {
+const Description = ({ onLoadMore, isLoadingMore }) => {
const candidatesListArr = useSelector(selectProfiles);
const itemsArr = useSelector(selectItems);
const filteredListArr = useSelector(selectFilteredCandidates);
@@ -65,7 +66,10 @@ const Description = ({ onLoadMore }) => {
{localStorage.clear(); dispatch(auth(false));}}>
-
+
+
)
}
\ No newline at end of file
diff --git a/src/components/Select/TagSelect.js b/src/components/Select/TagSelect.js
index 0da18aad..f1456bf7 100644
--- a/src/components/Select/TagSelect.js
+++ b/src/components/Select/TagSelect.js
@@ -1,28 +1,29 @@
-import React from 'react';
+import React, { useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import Select from 'react-select';
import { Loader } from '../Loader/Loader';
import style from './TagSelect.module.css';
import { selectedItems, selectItems, selectTags, filteredCandidates, setPositionId } from '../../redux/outstaffingSlice';
import { fetchItemsForId } from '../../server/server';
-import { selectIsLoading } from '../../redux/loaderSlice';
const TagSelect = () => {
+ const [searchLoading, setSearchLoading] = useState(false);
const dispatch = useDispatch();
- const isLoading = useSelector(selectIsLoading)
const itemsArr = useSelector(selectItems);
const tagsArr = useSelector(selectTags);
- const handleSubmit = ({ dispatch }) => {
+ const handleSubmit = ({ dispatch, setSearchLoading }) => {
+ setSearchLoading(true)
dispatch(setPositionId(null));
const filterItemsId = itemsArr.map((item) => item.id).join();
- fetchItemsForId(`${process.env.REACT_APP_API_URL}/api/profile?skills=`, filterItemsId).then((el) =>
+ fetchItemsForId(`${process.env.REACT_APP_API_URL}/api/profile?skills=`, filterItemsId).then((el) => {
dispatch(filteredCandidates(el))
- );
+ setSearchLoading(false)
+ });
// dispatch(selectedItems([]));
};
@@ -45,8 +46,8 @@ const TagSelect = () => {
return { id: item.id, value: item.value, label: item.value };
})}
/>
-