Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0440b36f24 | |||
| de56fb601a |
@@ -5,7 +5,6 @@ import { useSelector } from "react-redux";
|
||||
export default function FamilyParentDashboard({
|
||||
className,
|
||||
bannerList,
|
||||
nextDueTask,
|
||||
}) {
|
||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
// import HomeSliders from "./HomeSliders";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function HomeDashboard({ className, bannerList, nextDueTask }) {
|
||||
export default function HomeDashboard({ className, bannerList }) {
|
||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||
|
||||
let loginDate = userDetails?.last_login.split(" ")[0];
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useSelector } from "react-redux";
|
||||
export default function JobOwnerDashboard({
|
||||
className,
|
||||
bannerList,
|
||||
nextDueTask,
|
||||
}) {
|
||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useSelector } from "react-redux";
|
||||
export default function WorkerDashboard({
|
||||
className,
|
||||
bannerList,
|
||||
nextDueTask,
|
||||
}) {
|
||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ export default function FullAccountDash(props) {
|
||||
className="mb-4"
|
||||
data={userDetails}
|
||||
bannerList={props.bannerList}
|
||||
nextDueTask={props.nextDueTask}
|
||||
/>
|
||||
);
|
||||
case "FAMILY_PARENT_DASH":
|
||||
@@ -31,7 +30,6 @@ export default function FullAccountDash(props) {
|
||||
className="mb-4"
|
||||
data={userDetails}
|
||||
bannerList={props.bannerList}
|
||||
nextDueTask={props.nextDueTask}
|
||||
/>
|
||||
);
|
||||
case "WORKER_HOME_DASH":
|
||||
@@ -40,7 +38,6 @@ export default function FullAccountDash(props) {
|
||||
className="mb-4"
|
||||
data={userDetails}
|
||||
bannerList={props.bannerList}
|
||||
nextDueTask={props.nextDueTask}
|
||||
/>
|
||||
);
|
||||
case "JOBOWNER_HOME_DASH":
|
||||
@@ -49,7 +46,6 @@ export default function FullAccountDash(props) {
|
||||
className="mb-4"
|
||||
data={userDetails}
|
||||
bannerList={props.bannerList}
|
||||
nextDueTask={props.nextDueTask}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
|
||||
@@ -12,14 +12,9 @@ export default function Home(props) {
|
||||
const userApi = new usersService();
|
||||
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
||||
|
||||
let [nextDueTask, setNextDueTask] = useState({});
|
||||
|
||||
// const [MyOffersList, setMyOffersList] = useState({loading: true, data: []});
|
||||
|
||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||
|
||||
const [MyActiveJobList, setMyActiveJobList] = useState({loading:true, data:[]}); // STATE TO HOLD ACTIVE/CURRENT TASKS
|
||||
// const [MyActiveJobList, setMyActiveJobList] = useState([]); // STATE TO HOLD ACTIVE/CURRENT TASKS
|
||||
|
||||
const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST
|
||||
try {
|
||||
@@ -34,19 +29,19 @@ export default function Home(props) {
|
||||
};
|
||||
|
||||
// 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 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 {
|
||||
@@ -59,11 +54,8 @@ export default function Home(props) {
|
||||
// };
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
await Promise.all([getHomeDate(), getMyActiveJobList()]);
|
||||
};
|
||||
if(userDetails?.account_type == 'FULL'){
|
||||
fetchData();
|
||||
getMyActiveJobList();
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -83,7 +75,6 @@ export default function Home(props) {
|
||||
/>
|
||||
) : userDetails && userDetails?.account_type == "FULL" ? (
|
||||
<FullAccountDash
|
||||
nextDueTask={nextDueTask}
|
||||
bannerList={props.bannerList}
|
||||
dashTypes={props.dashTypes}
|
||||
// offersList={MyOffersList}
|
||||
|
||||
Reference in New Issue
Block a user