diff --git a/src/assets/images/taskbanners/clean-closet.jpg b/src/assets/images/taskbanners/clean-closet.jpg new file mode 100644 index 0000000..1116d7a Binary files /dev/null and b/src/assets/images/taskbanners/clean-closet.jpg differ diff --git a/src/assets/images/taskbanners/default.jpg b/src/assets/images/taskbanners/default.jpg new file mode 100644 index 0000000..fc7c165 Binary files /dev/null and b/src/assets/images/taskbanners/default.jpg differ diff --git a/src/assets/images/taskbanners/kid-clean.jpg b/src/assets/images/taskbanners/kid-clean.jpg new file mode 100644 index 0000000..e6d6edb Binary files /dev/null and b/src/assets/images/taskbanners/kid-clean.jpg differ diff --git a/src/assets/images/taskbanners/kid-coffee.jpg b/src/assets/images/taskbanners/kid-coffee.jpg new file mode 100644 index 0000000..f9dec94 Binary files /dev/null and b/src/assets/images/taskbanners/kid-coffee.jpg differ diff --git a/src/assets/images/taskbanners/kid-dishes.jpg b/src/assets/images/taskbanners/kid-dishes.jpg new file mode 100644 index 0000000..036c574 Binary files /dev/null and b/src/assets/images/taskbanners/kid-dishes.jpg differ diff --git a/src/assets/images/taskbanners/kid-laundary.jpg b/src/assets/images/taskbanners/kid-laundary.jpg new file mode 100644 index 0000000..9673d54 Binary files /dev/null and b/src/assets/images/taskbanners/kid-laundary.jpg differ diff --git a/src/assets/images/taskbanners/kid-room.jpg b/src/assets/images/taskbanners/kid-room.jpg new file mode 100644 index 0000000..ffdeee5 Binary files /dev/null and b/src/assets/images/taskbanners/kid-room.jpg differ diff --git a/src/assets/images/taskbanners/wash-car.jpg b/src/assets/images/taskbanners/wash-car.jpg new file mode 100644 index 0000000..ce211d3 Binary files /dev/null and b/src/assets/images/taskbanners/wash-car.jpg differ diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index aca1aee..232575c 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -139,24 +139,37 @@ export default function Login() { // In order to update the selected login type whenever the component renders // useEffect(() => { - // document.cookie.includes("loginType=family") ? "loginfamily" : "loginfull" - - // Set the loginType cookie to remember the user's selection - // document.cookie = "loginType=family; expires=Session; path=/;"; - - // Clear the loginType cookie if the user switches to loginfull + // Clear the loginType cookie if the user switches to loginfull // document.cookie ="loginType=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; // }, []); useLayoutEffect(()=>{ // checks the cookie in order to set the login type before components mounts - if(document.cookie.includes("loginType=family")){ - setLoginType('family') - }else if(document.cookie.includes("loginType=full")){ - setLoginType('full') - }else{ - setLoginType('full') + // if(document.cookie.includes("loginType=family")){ + // setLoginType('family') + // }else if(document.cookie.includes("loginType=full")){ + // setLoginType('full') + // }else{ + // setLoginType('full') + // } + function readCookie(cname) { // checks the cookie in order to set the login type before components mounts + let name = cname + "="; + let decoded_cookie = decodeURIComponent(document.cookie); + let carr = decoded_cookie.split(';'); + for(let i=0; i { setMail(""); diff --git a/src/components/Cards/FamilyActiveJobsCard.jsx b/src/components/Cards/FamilyActiveJobsCard.jsx new file mode 100644 index 0000000..6aca49b --- /dev/null +++ b/src/components/Cards/FamilyActiveJobsCard.jsx @@ -0,0 +1,120 @@ +import { useState } from "react"; +import { Link, useLocation } from "react-router-dom"; +import { toast } from "react-toastify"; +import localImgLoad from "../../lib/localImgLoad"; +import CountDown from "../Helpers/CountDown"; +import Icons from "../Helpers/Icons"; + +export default function FamilyActiveJobsCard({ datas, hidden = false }) { + + let { pathname } = useLocation(); + console.log('TESTING11111',datas) + + const [imageUrl, setImageUrl] = useState(""); + const [addFavorite, setValue] = useState(false); + const [options, setOption] = useState(false); + const favoriteHandler = () => { + if (!addFavorite) { + setValue(true); + toast.success("Added to Favorite List"); + } else { + setValue(false); + toast.warn("Remove to Favorite List"); + } + }; + + return ( +
+
+ {/* thumbnail */} +
+ {/* thumbnail image */} +
+ {/*
*/} + {/**/} + {/* */} + {/**/} + {/* setOption(!options)}*/} + {/* className="w-7 h-7 flex justify-center items-center bg-white rounded-full cursor-pointer"*/} + {/* >*/} + {/* */} + {/**/} + {/* {options && (*/} + {/* setOption(!options)}*/} + {/* className="w-full h-screen fixed top-0 left-0 z-10"*/} + {/* >
*/} + {/* )}*/} + {/* */} + + {/*
*/} + {/*
*/} + {hidden && ( +
+ +
+ )} +
+
+ {/* details */} +
+ {/* product title */} + + {datas.title} + + {/* countdown */} +
+
+

+ Task Code +

+

+ {datas.contract} +

+
+
+
+

+ Remaining Time +

+

+ +

+
+
+
+ +
+ + View + +
+ + ); +} diff --git a/src/components/Home/FamilyActiveLSlde.jsx b/src/components/Home/FamilyActiveLSlde.jsx index a377615..6d7ff35 100644 --- a/src/components/Home/FamilyActiveLSlde.jsx +++ b/src/components/Home/FamilyActiveLSlde.jsx @@ -1,20 +1,22 @@ import React, { useRef } from "react"; -import ProductCardStyleOne from "../Cards/ProductCardStyleOne"; +//import ProductCardStyleOne from "../Cards/ProductCardStyleOne"; import Icons from "../Helpers/Icons"; import SliderCom from "../Helpers/SliderCom"; +import FamilyActiveJobsCard from "../Cards/FamilyActiveJobsCard"; export default function FamilyActiveLSlde({ className, trending }) { const settings = { arrows: false, slidesToShow: 3, slidesToScroll: 3, - infinite: true, + infinite: trending?.length > 3, responsive: [ { breakpoint: 1025, settings: { slidesToShow: 3, slidesToScroll: 3, + infinite: trending?.length > 3, }, }, { @@ -22,6 +24,7 @@ export default function FamilyActiveLSlde({ className, trending }) { settings: { slidesToShow: 2, slidesToScroll: 2, + infinite: trending?.length > 2, }, }, { @@ -29,6 +32,7 @@ export default function FamilyActiveLSlde({ className, trending }) { settings: { slidesToShow: 1, slidesToScroll: 1, + infinite: trending?.length > 1, }, }, ], @@ -94,7 +98,7 @@ export default function FamilyActiveLSlde({ className, trending }) { {trending && trending.length > 0 && trending.map((item) => ( - + ))} diff --git a/src/components/Home/FamilyDash.jsx b/src/components/Home/FamilyDash.jsx index ae85faa..1895363 100644 --- a/src/components/Home/FamilyDash.jsx +++ b/src/components/Home/FamilyDash.jsx @@ -6,16 +6,20 @@ import FamilyActiveLSlde from "./FamilyActiveLSlde"; import ParentWaiting from "../MyPendingJobs/ParentWaiting"; import MyOffersFamilyTable from "../MyTasks/MyOffersFamilyTable"; -export default function FamilyDash({familyOffers}) { +export default function FamilyDash({familyOffers, MyActiveJobList}) { console.log("PROPS IN FAMILY DASH->", familyOffers); - const trending = datas.datas; + const trending = MyActiveJobList; return (
{/* */} + + {trending && trending.length > 0 && + } + {/**/}
diff --git a/src/components/Home/index.jsx b/src/components/Home/index.jsx index 1890b71..42da14f 100644 --- a/src/components/Home/index.jsx +++ b/src/components/Home/index.jsx @@ -8,15 +8,26 @@ import FullAccountDash from "./FullAccountDash"; export default function Home(props) { console.log("PROPS IN HOME->", props); + const userApi = new usersService(); + const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner); let [nextDueTask, setNextDueTask] = useState({}); const [MyOffersList, setMyOffersList] = useState([]); - const userApi = new usersService(); - const { userDetails } = useSelector((state) => state?.userDetails); - const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner); + const [MyActiveJobList, setMyActiveJobList] = useState([]); // STATE TO HOLD ACTIVE/CURRENT TASKS + + const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST + try { + const res = await userApi.getMyActiveTaskList(); + setMyActiveJobList(res?.data?.result_list); + } catch (error) { + setMyActiveJobList([]); + console.log("Error getting tasks"); + } + }; + // FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME const getHomeDate = () => { @@ -50,6 +61,10 @@ export default function Home(props) { fetchData(); }, []); + useEffect(() => { + getMyActiveJobList(); + }, []); + return (
@@ -58,6 +73,7 @@ export default function Home(props) { account={userDetails} commonHeadData={props.bannerList} familyOffers={MyOffersList} + MyActiveJobList={MyActiveJobList} /> ) : userDetails && userDetails?.account_type == "FULL" ? (
data diff --git a/src/data/product_data.json b/src/data/product_data.json index 83ec6c3..0083eef 100644 --- a/src/data/product_data.json +++ b/src/data/product_data.json @@ -6,8 +6,8 @@ "profile_img": "profile.png", "price": "75,320 ETH", "thumbnil": "tranding-1.jpg", - "remaing": "2023-03-04 4:00:00", - "title": "laborum cupidatat sit" + "remaing": "2023-08-04 4:00:00", + "title": "Wash Dishes" }, { "id": 1, @@ -15,8 +15,8 @@ "profile_img": "profile.png", "price": "75,320 ETH", "thumbnil": "tranding-2.jpg", - "remaing": "2023-03-04 4:00:00", - "title": "velit occaecat voluptate" + "remaing": "2023-07-24 4:00:00", + "title": "Wash Planes" }, { "id": 2, @@ -24,7 +24,7 @@ "profile_img": "profile.png", "price": "75,320 ETH", "thumbnil": "tranding-3.jpg", - "remaing": "2023-03-04 4:00:00", + "remaing": "2023-07-17 4:00:00", "title": "est reprehenderit amet" }, { @@ -33,7 +33,7 @@ "profile_img": "profile.png", "price": "75,320 ETH", "thumbnil": "tranding-4.jpg", - "remaing": "2023-03-04 4:00:00", + "remaing": "2023-08-04 4:00:00", "title": "velit tempor nostrud" }, { @@ -42,7 +42,7 @@ "profile_img": "profile.png", "price": "75,320 ETH", "thumbnil": "tranding-4.jpg", - "remaing": "2023-03-04 4:00:00", + "remaing": "2023-09-04 4:00:00", "title": "adipisicing sit nostrud" }, {