diff --git a/src/components/Description/Description.js b/src/components/Description/Description.js index 29e82175..ea79e08e 100644 --- a/src/components/Description/Description.js +++ b/src/components/Description/Description.js @@ -11,6 +11,7 @@ import { Loader } from '../Loader/Loader'; import { getRole } from '../../redux/roleSlice'; const Description = ({ onLoadMore, isLoadingMore }) => { + const [isLoaded, setIsLoaded] = useState(false); const history = useHistory(); const role = useSelector(getRole) const candidatesListArr = useSelector(selectProfiles); @@ -19,7 +20,10 @@ const Description = ({ onLoadMore, isLoadingMore }) => { const [allCandidates, getAllCandidates] = useState([]); useEffect(() => { - fetchProfile({ link: `${process.env.REACT_APP_API_URL}/api/profile?limit=`, index: 1000, history, role }).then((p) => getAllCandidates(p)); + fetchProfile({ link: `${process.env.REACT_APP_API_URL}/api/profile?limit=`, index: 1000, history, role }).then((p) => { + getAllCandidates(p); + setIsLoaded(true); + }); }, []); if(!filteredListArr) { @@ -28,7 +32,7 @@ const Description = ({ onLoadMore, isLoadingMore }) => {
{ - candidatesListArr.map((el) => ( + candidatesListArr.length > 0 ? candidatesListArr.map((el) => (
@@ -62,7 +66,9 @@ const Description = ({ onLoadMore, isLoadingMore }) => {
- ))} + )) :
{ + isLoaded ? 'В данный момент в категории нет свободных специалистов' : 'Загрузка...' + }
}
@@ -87,7 +93,7 @@ const Description = ({ onLoadMore, isLoadingMore }) => {
- {filteredListArr + {filteredListArr && filteredListArr.length > 0 ? filteredListArr.map((el) => (
@@ -123,7 +129,7 @@ const Description = ({ onLoadMore, isLoadingMore }) => {
)) - : filteredListArr.length && filteredListArr.length === 0 && <> } + :
В данный момент в категории нет свободных специалистов
}
diff --git a/src/components/Description/Description.module.css b/src/components/Description/Description.module.css index ba2bd244..fc5ac83f 100644 --- a/src/components/Description/Description.module.css +++ b/src/components/Description/Description.module.css @@ -3,6 +3,16 @@ margin-bottom: 120px; } +.description__empty { + font-family: 'GT Eesti Pro Display'; + font-size: 2.4em; + font-weight: 500; + font-style: normal; + letter-spacing: normal; + line-height: normal; + text-align: center; +} + .description__wrapper { border: 1px solid #efefef; background-color: #fdfdfd; diff --git a/src/pages/formPage.scss b/src/pages/formPage.scss index 9dc51cd1..4d7171c5 100644 --- a/src/pages/formPage.scss +++ b/src/pages/formPage.scss @@ -127,7 +127,7 @@ } .form-page footer { - margin-top: 2.5rem !important; + margin-top: 6rem !important; } @media (max-width: 991px) {