Compare commits

...

3 Commits

Author SHA1 Message Date
victorAnumudu f4de95ae86 removed unused common banner 2024-11-25 12:43:12 +01:00
CHIEFSOFT\ameye 45d6220054 removed comments 2024-11-23 07:34:57 -05:00
victor.ebuka 95a89c1ccc Merge branch 'suspense-loading-added' of WrenchBoard/Users-Wrench into master 2024-11-23 04:57:34 +00:00
3 changed files with 5 additions and 81 deletions
+3 -78
View File
@@ -9,87 +9,12 @@ import LoadingSpinner from '../../components/Spinners/LoadingSpinner'
export default function Home(props) {
// console.log("PROPS IN HOME->", props);
const userApi = new usersService();
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
// const userApi = new usersService();
// const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
const { userDetails } = useSelector((state) => state?.userDetails);
// const [MyActiveJobList, setMyActiveJobList] = useState({loading:true, data:[]}); // STATE TO HOLD ACTIVE/CURRENT TASKS
// const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST
// try {
// const res = await userApi.getMyActiveTaskList();
// setMyActiveJobList({loading:false, data:res?.data?.result_list});
// // setMyActiveJobList(res?.data?.result_list);
// } catch (error) {
// setMyActiveJobList({loading:false, data:[]});
// // setMyActiveJobList([]);
// console.log("Error getting tasks");
// }
// };
// FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
// const getHomeDate = () => {
// userApi
// .getHomeDate()
// .then((res) => {
// if (res.status != 200 || res.internal_return < 0) {
// return;
// }
// setNextDueTask(res.data);
// })
// .catch((error) => {
// console.log(error);
// });
// };
// const getMyOffersList = async () => {
// try {
// const res = await userApi.getOffersList();
// setMyOffersList({loading:false, data:res.data});
// } catch (error) {
// setMyOffersList({loading:false, data:[]});
// console.log("Error getting offers", error);
// }
// };
// useEffect(() => {
// if(userDetails?.account_type == 'FULL'){
// getMyActiveJobList();
// }
// }, []);
return (
<Layout>
{/* {Object.keys(commonHeadBanner).length < 1 ?
<LoadingSpinner height='h-48' size='16' />
:
<div className="w-full">
{userDetails && userDetails?.account_type == "FAMILY" ? (
<FamilyDash
account={userDetails}
commonHeadData={props.bannerList}
// familyOffers={MyOffersList?.data}
serverImg = {userDetails?.session_image_server}
// MyActiveJobList={MyActiveJobList?.data}
/>
) : userDetails && userDetails?.account_type == "FULL" ? (
<FullAccountDash
bannerList={props.bannerList}
dashTypes={props.dashTypes}
// offersList={MyOffersList}
// MyActiveJobList={MyActiveJobList}
offersList={props.offersList}
imageServer={props.imageServer}
/>
) : (
<div>
You are not logged in or your account type is not supported.
</div>
)}
</div>
} */}
<div className="w-full">
{userDetails && userDetails?.account_type == "FAMILY" ? (
<FamilyDash
@@ -101,7 +26,7 @@ export default function Home(props) {
/>
) : userDetails && userDetails?.account_type == "FULL" ? (
<>
{Object.keys(commonHeadBanner).length < 1 ?
{props?.bannerList?.length < 1 ?
<LoadingSpinner height='h-48' size='16' />
:
<FullAccountDash
+2
View File
@@ -326,7 +326,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}, [isLogin.status]);
useEffect(()=>{ // sends an event to the socket to enable user join a room to be able to receive update when jobs enters the market
if(loggedIn || isLogin.status){
joinRoom('full-markets-jobs')
}
},[isLogin.status])
useEffect(()=>{ // sends an event to the socket to enable user join a room to be able to receive update for parent child job assign
-3
View File
@@ -4,11 +4,8 @@ import Home from "../components/Home";
export default function HomePages() {
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
const [bannerOptions, setBannerOptions] = useState({})
useEffect(()=>{
const bannerOptions = {
bannerList: commonHeadBanner?.result_list,