common home banner head implemented

This commit is contained in:
victorAnumudu
2023-06-10 21:30:31 +01:00
parent d0e1a7acd0
commit 3461b828dd
15 changed files with 100 additions and 236 deletions
+14
View File
@@ -6,6 +6,7 @@ import { useDispatch, useSelector } from "react-redux";
import { updateUserDetails } from "../store/UserDetails";
import { updateJobs } from "../store/jobLists";
import { updateUserJobList } from "../store/userJobList";
import { commonHeadBanner } from "../store/CommonHeadBanner";
const AuthRoute = ({ redirectPath = "/login", children }) => {
const apiCall = useMemo(() => new usersService(), []);
@@ -120,6 +121,19 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
getMarketActiveJobList();
}, [apiCall, dispatch]);
//FUNCTION TO GET COMMON HEAD DATA
useEffect(()=>{
apiCall.getHeroJBanners().then((res) => {
if (res.data.internal_return < 0) {
return;
}
dispatch(commonHeadBanner(res.data));
})
.catch((error) => {
console.log('ERROR ', error)
});
},[])
return isLogin.loading ? (
<LoadingSpinner size="32" color="sky-blue" height="h-screen" />
) : // Stills needs fixing