Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 944fd134f6 | |||
| a910ab177f | |||
| 4e741f587c | |||
| f779529cc6 | |||
| 44cedf2f65 | |||
| fbcba191b0 |
@@ -89,9 +89,9 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
<div className="field w-full mb-6 xl:mb-0">
|
<div className="field w-full mb-6 xl:mb-0">
|
||||||
<label
|
<label
|
||||||
htmlFor="country"
|
htmlFor="country"
|
||||||
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex item-center gap-1"
|
className="job-label job-label-flex"
|
||||||
>
|
>
|
||||||
Currency
|
<span>Currency</span>
|
||||||
{props.errors.country && props.touched.country && (
|
{props.errors.country && props.touched.country && (
|
||||||
<span className="text-[12px] text-red-500">
|
<span className="text-[12px] text-red-500">
|
||||||
{props.errors.country}
|
{props.errors.country}
|
||||||
@@ -136,9 +136,9 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
{/* Price */}
|
{/* Price */}
|
||||||
<div className="field w-full">
|
<div className="field w-full">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6 text-right"
|
fieldClass="px-6 text-right flex"
|
||||||
label="Price"
|
label="Price"
|
||||||
labelClass="tracking-wide"
|
labelClass=""
|
||||||
type="number"
|
type="number"
|
||||||
name="price"
|
name="price"
|
||||||
placeholder="0"
|
placeholder="0"
|
||||||
@@ -159,7 +159,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
label="Title"
|
label="Title"
|
||||||
labelClass="tracking-wide"
|
labelClass=""
|
||||||
type="text"
|
type="text"
|
||||||
name="title"
|
name="title"
|
||||||
value={props.values.title}
|
value={props.values.title}
|
||||||
@@ -178,7 +178,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
label="Description"
|
label="Description"
|
||||||
labelClass="tracking-wide"
|
labelClass=""
|
||||||
type="text"
|
type="text"
|
||||||
name="description"
|
name="description"
|
||||||
value={props.values.description}
|
value={props.values.description}
|
||||||
@@ -197,7 +197,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
<div className="sm:w-[60%] w-full">
|
<div className="sm:w-[60%] w-full">
|
||||||
<label
|
<label
|
||||||
htmlFor="Job Delivery Details"
|
htmlFor="Job Delivery Details"
|
||||||
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1"
|
className="job-label job-label-flex"
|
||||||
>
|
>
|
||||||
Job Delivery Details
|
Job Delivery Details
|
||||||
{props.errors.job_detail &&
|
{props.errors.job_detail &&
|
||||||
@@ -220,13 +220,13 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="sm:w-[35%] w-full">
|
<div className="sm:w-[35%] w-full">
|
||||||
<div
|
<label
|
||||||
htmlFor="Job Categories"
|
htmlFor="Job Categories"
|
||||||
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"'
|
className='job-label'
|
||||||
id="checked-group"
|
id="checked-group"
|
||||||
>
|
>
|
||||||
Categories
|
Categories
|
||||||
</div>
|
</label>
|
||||||
<div
|
<div
|
||||||
className="sm:flex-col flex flex-wrap px-3 mt-3"
|
className="sm:flex-col flex flex-wrap px-3 mt-3"
|
||||||
role="group"
|
role="group"
|
||||||
@@ -266,7 +266,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
<div className="field w-full mb-[5px]">
|
<div className="field w-full mb-[5px]">
|
||||||
<div className={`flex items-center justify-between mb-2.5`}>
|
<div className={`flex items-center justify-between mb-2.5`}>
|
||||||
<label
|
<label
|
||||||
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
|
className="job-label"
|
||||||
htmlFor="timeline_days"
|
htmlFor="timeline_days"
|
||||||
>
|
>
|
||||||
Timeline
|
Timeline
|
||||||
@@ -328,10 +328,10 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
<div className="flex items-center space-x-4 mr-9">
|
<div className="flex items-center space-x-4 mr-9">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-18 text-light-red tracking-wide "
|
className="text-18 tracking-wide h-11 flex justify-center items-center border border-light-red text-base rounded-full text-light-red cursor-pointer"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="border-b dark:border-[#5356fb29] border-light-red"
|
className="px-2"
|
||||||
onClick={popUpHandler}
|
onClick={popUpHandler}
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
|
|||||||
@@ -47,19 +47,25 @@ export default function SocketIOContextProvider({children}) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
socket.on("receive_message", (data) => {
|
socket.on("receive_message", (data) => {
|
||||||
// setSocketMsgReceived(data.message);
|
// setSocketMsgReceived(data.message);
|
||||||
dispatch(tableReload({type:'CHATMESSAGELIST'}))
|
dispatch(tableReload({type:'CHATMESSAGELIST'})) // dispatches to update chat message sending from owner to worker and vice versa
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("received_refreshmarket_jobs", (data) => {
|
socket.on("received_refreshmarket_jobs", (data) => {
|
||||||
// setSocketMsgReceived(data.message);
|
// setSocketMsgReceived(data.message);
|
||||||
dispatch(tableReload({type:'MARKETTABLELIST'}))
|
dispatch(tableReload({type:'MARKETTABLELIST'})) // dispatches to update market list on full account
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("family_actions", (data) => {
|
socket.on("family_actions", (data) => {
|
||||||
// setSocketMsgReceived(data.message);
|
// setSocketMsgReceived(data.message);
|
||||||
let user_uid = userDetails.account_type == 'FULL' ? userDetails.uid : sessionStorage.getItem('family_uid')
|
let user_uid = userDetails.account_type == 'FULL' ? userDetails.uid : sessionStorage.getItem('family_uid') // gets user UID
|
||||||
let {message} = data
|
let {message} = data
|
||||||
if(message.action == "REFRESH_OFFER" && message.family_uid == user_uid && message.audience == "MEMBER"){
|
if(message.action == "REFRESH_OFFER" && message.family_uid == user_uid && message.audience == "MEMBER"){ // for refreshing child account when parent assigns a job
|
||||||
dispatch(tableReload({type:'FAMILYOFFERLIST'}))
|
dispatch(tableReload({type:'FAMILYOFFERLIST'})) // dispatches to update family pending/offer list on family side
|
||||||
}
|
}
|
||||||
|
if(message.action == "REFRESH_TASK" && message.audience == "PARENT"){ // for refreshing parent account when child accepts or rejects a job
|
||||||
|
dispatch(tableReload({type:'PARENTFAMILYTASKLIST'})) // dispatches to update parent family task list on parent side
|
||||||
|
}
|
||||||
|
// console.log('DATA', data)
|
||||||
});
|
});
|
||||||
}, [socket]);
|
}, [socket]);
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,13 @@ export default function FamilyActivities() {
|
|||||||
<span>Family</span>
|
<span>Family</span>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<Suspense fallback={<LoadingSpinner color="sky-blue" size="16" />}>
|
<Suspense
|
||||||
|
fallback={
|
||||||
|
<div className="bg-white">
|
||||||
|
<LoadingSpinner color="sky-blue" size="16" height='h-[30rem]' />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
<FamilyTableNew />
|
<FamilyTableNew />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { Suspense, useEffect, useState } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
@@ -23,7 +23,9 @@ const AssignTaskPopout = ({
|
|||||||
|
|
||||||
}) => {
|
}) => {
|
||||||
const {parentAssignJobToKid} = SocketValues()
|
const {parentAssignJobToKid} = SocketValues()
|
||||||
|
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
|
|
||||||
let { pathname, state } = useLocation();
|
let { pathname, state } = useLocation();
|
||||||
|
|
||||||
const {userDetails} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
const {userDetails} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
||||||
@@ -80,7 +82,7 @@ const AssignTaskPopout = ({
|
|||||||
setRequestStatus({ loading: true, status: false, message: "" });
|
setRequestStatus({ loading: true, status: false, message: "" });
|
||||||
|
|
||||||
if(!selectedFamilyUid){ // If no family found, throw error
|
if(!selectedFamilyUid){ // If no family found, throw error
|
||||||
setRequestStatus({ loading: false, status: false, message: "Please Select Family Member" });
|
setRequestStatus({ loading: false, status: false, message: "Please Select a Kid" });
|
||||||
return setTimeout(() => {
|
return setTimeout(() => {
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
}, 3000);
|
}, 3000);
|
||||||
@@ -219,7 +221,10 @@ const AssignTaskPopout = ({
|
|||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
}, 5000);
|
}, 5000);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let imageSrc = (localStorage.getItem("session_token")
|
||||||
|
? `${userDetails?.session_image_server}${localStorage.getItem("session_token")}/job/${activeTask.data.job_uid}` : ""); // FOR GETTING JOB IMAGE
|
||||||
|
|
||||||
useEffect(()=>{ // effect to update family UID when components mounts
|
useEffect(()=>{ // effect to update family UID when components mounts
|
||||||
if(familyDetailsData?.uid){
|
if(familyDetailsData?.uid){
|
||||||
@@ -231,12 +236,13 @@ const AssignTaskPopout = ({
|
|||||||
}
|
}
|
||||||
},[])
|
},[])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ModalCom action={action} situation={situation}>
|
<ModalCom action={action} situation={situation}>
|
||||||
<div className="w-11/12 lg:w-[700px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
<div className="w-11/12 lg:w-[700px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
<div className="w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] bg-sky-blue/50 border-b dark:border-[#5356fb29] border-light-purple">
|
<div className="modal-header-con">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide flex items-center">
|
<h1 className="modal-title">
|
||||||
{details ? (
|
{details ? (
|
||||||
` Assign ${details?.firstname}'s Task`
|
` Assign ${details?.firstname}'s Task`
|
||||||
) : familyDetailsData ? (
|
) : familyDetailsData ? (
|
||||||
@@ -244,11 +250,11 @@ const AssignTaskPopout = ({
|
|||||||
) : (
|
) : (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<span className="text-black">Assign task to{" "}</span>
|
<span className="text-black">Assign task to{" "}</span>
|
||||||
<div className="w-[270px] h-[40px] flex items-center relative after:absolute after:content-['▼'] active:after:rotate-180 after:transition-all after:duration-300 after:z-20 after:right-2 after:top-1/2 after:-translate-y-1/2 after:text-white after:text-lg">
|
<div className="w-[270px] h-[40px] flex items-center">
|
||||||
<select
|
<select
|
||||||
name=""
|
name=""
|
||||||
id=""
|
id=""
|
||||||
className="relative z-10 appearance-none text-lg text-white px-2 tracking-wide font-semibold transition-all cursor-pointer bg-blue-900 focus:outline-none border border-gray-200 rounded-full w-full h-full"
|
className="text-lg text-black/80 px-2 tracking-wide font-semibold transition-all cursor-pointer bg-white focus:outline-none border border-gray-200 rounded-full w-full h-full"
|
||||||
onChange={handleFamChange}
|
onChange={handleFamChange}
|
||||||
value={selectedFamilyUid}
|
value={selectedFamilyUid}
|
||||||
>
|
>
|
||||||
@@ -263,7 +269,7 @@ const AssignTaskPopout = ({
|
|||||||
</h1>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#000] dark:text-red-500"
|
className="modal-close-btn"
|
||||||
onClick={action}
|
onClick={action}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -382,25 +388,37 @@ const AssignTaskPopout = ({
|
|||||||
value={activeTask?.data?.description}
|
value={activeTask?.data?.description}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center">
|
<div className="grid grid-cols-2">
|
||||||
<div className="my-3 w-full flex items-center gap-1">
|
<div className="w-full">
|
||||||
<label className="job-label">
|
<div className="my-3 w-full flex items-center gap-1">
|
||||||
Price
|
<label className="job-label">
|
||||||
</label>
|
Price
|
||||||
<p className="p-1 text-sm text-slate-900 dark:text-white">
|
</label>
|
||||||
{PriceFormatter(
|
<p className="p-1 text-sm text-slate-900 dark:text-white">
|
||||||
activeTask?.data?.price * 0.01,
|
{PriceFormatter(
|
||||||
activeTask?.data?.currency,
|
activeTask?.data?.price * 0.01,
|
||||||
activeTask?.data?.curreny_code
|
activeTask?.data?.currency,
|
||||||
)}
|
activeTask?.data?.curreny_code
|
||||||
</p>
|
)}
|
||||||
</div>
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="my-3 w-full flex items-center gap-1">
|
<div className="my-3 w-full flex items-center gap-1">
|
||||||
<label className="job-label">
|
<label className="job-label">
|
||||||
Timeline
|
Timeline
|
||||||
</label>
|
</label>
|
||||||
<p className="p-1 text-sm text-slate-900 dark:text-white">{`${activeTask?.data?.timeline_days} day(s)`}</p>
|
<p className="p-1 text-sm text-slate-900 dark:text-white">{`${activeTask?.data?.timeline_days} day(s)`}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="w-full flex items-center justify-center">
|
||||||
|
<div className="w-28 h-28 rounded-2xl flex items-center justify-center">
|
||||||
|
<img
|
||||||
|
className="w-full h-auto"
|
||||||
|
loading="lazy"
|
||||||
|
src={imageSrc}
|
||||||
|
alt='job image'
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { apiConst } from "../../lib/apiConst";
|
|||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import AssignTaskPopout from "./FamilyPopout/AssignTaskPopout";
|
import AssignTaskPopout from "./FamilyPopout/AssignTaskPopout";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
// Lazy Imports for components
|
// Lazy Imports for components
|
||||||
const FamilyWaitlist = lazy(() => import("./Tabs/FamilyNewWaitlist"));
|
const FamilyWaitlist = lazy(() => import("./Tabs/FamilyNewWaitlist"));
|
||||||
@@ -11,11 +12,15 @@ const FamilyTasks = lazy(() => import("./Tabs/FamilyNewTasks"));
|
|||||||
const FamilyPending = lazy(() => import("./Tabs/FamilyNewPending"));
|
const FamilyPending = lazy(() => import("./Tabs/FamilyNewPending"));
|
||||||
|
|
||||||
export default function FamilyTableNew() {
|
export default function FamilyTableNew() {
|
||||||
|
|
||||||
|
const { parentFamilyTaskList } = useSelector((state) => state.tableReload);
|
||||||
|
console.log('parentFamilyTaskList', parentFamilyTaskList)
|
||||||
|
|
||||||
let { pathname } = useLocation();
|
let { pathname } = useLocation();
|
||||||
|
|
||||||
// Initial state for family details
|
// Initial state for family details
|
||||||
const initialDetailState = {
|
const initialDetailState = {
|
||||||
loading: false,
|
loading: true,
|
||||||
data: null,
|
data: null,
|
||||||
link: "",
|
link: "",
|
||||||
};
|
};
|
||||||
@@ -115,13 +120,13 @@ export default function FamilyTableNew() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const manageFamily = async () => {
|
const manageFamily = async () => {
|
||||||
try {
|
try {
|
||||||
resetDetails();
|
// resetDetails();
|
||||||
|
|
||||||
setDetails({
|
// setDetails({
|
||||||
familyTasks: { loading: true },
|
// familyTasks: { loading: true },
|
||||||
familyWaitList: { loading: true },
|
// familyWaitList: { loading: true },
|
||||||
familyPending: { loading: true },
|
// familyPending: { loading: true },
|
||||||
});
|
// });
|
||||||
|
|
||||||
// const { family_uid } = accountDetails;
|
// const { family_uid } = accountDetails;
|
||||||
// const reqData = { family_uid };
|
// const reqData = { family_uid };
|
||||||
@@ -169,7 +174,13 @@ export default function FamilyTableNew() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
resetDetails();
|
// resetDetails();
|
||||||
|
setDetails({
|
||||||
|
familyDetails: { ...initialDetailState, loading: false, },
|
||||||
|
familyTasks: { ...initialDetailState, loading: false, },
|
||||||
|
familyWaitList: { ...initialDetailState, loading: false,},
|
||||||
|
familyPending: { ...initialDetailState, loading: false, },
|
||||||
|
})
|
||||||
setErrMsg("An error occurred");
|
setErrMsg("An error occurred");
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
@@ -177,7 +188,7 @@ export default function FamilyTableNew() {
|
|||||||
|
|
||||||
// Invoke the manageFamily function when the component mounts
|
// Invoke the manageFamily function when the component mounts
|
||||||
manageFamily();
|
manageFamily();
|
||||||
}, [updatePage]);
|
}, [updatePage, parentFamilyTaskList]);
|
||||||
|
|
||||||
// Effect to manage family tasks
|
// Effect to manage family tasks
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ const SuggestTask = ({ details, onClose, situation, continuePopupData }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalCom action={onClose} situation={situation}>
|
<ModalCom action={onClose} situation={situation}>
|
||||||
<div className="logout-modal-wrapper lw-[90%] md:w-[48rem] h-full lg:h-[627px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
<div className="logout-modal-wrapper lw-[90%] md:w-[48rem] min-h-[500px] bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||||
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[1.875rem] py-[1.4375rem] border-b dark:border-[#5356fb29] border-light-purple">
|
<div className="modal-header-con">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="modal-title">
|
||||||
{isManageFamilyPage
|
{isManageFamilyPage
|
||||||
? `${state?.firstname}'s Suggested Task`
|
? `${state?.firstname}'s Suggested Task`
|
||||||
: isActivitiesPage
|
: isActivitiesPage
|
||||||
@@ -95,7 +95,7 @@ const SuggestTask = ({ details, onClose, situation, continuePopupData }) => {
|
|||||||
</h1>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#374557] dark:text-red-500"
|
className="modal-close-btn"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -179,10 +179,10 @@ const SuggestTask = ({ details, onClose, situation, continuePopupData }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Description */}
|
{/* Description */}
|
||||||
<div className="field w-full mb-[.3125rem]">
|
<div className="w-full mb-[.3125rem]">
|
||||||
<label
|
<label
|
||||||
htmlFor="description"
|
htmlFor="description"
|
||||||
className='input-label text-[#181c32] dark:text-white text-[1.125rem] leading-[1.3102rem] font-semibold flex items-center gap-1'
|
className='job-label'
|
||||||
>
|
>
|
||||||
Description
|
Description
|
||||||
{props.errors.description &&
|
{props.errors.description &&
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default function InputCom({
|
|||||||
<div className={`flex items-center justify-between mb-2.5 ${labelClass}`}>
|
<div className={`flex items-center justify-between mb-2.5 ${labelClass}`}>
|
||||||
{label && (
|
{label && (
|
||||||
<label
|
<label
|
||||||
className={`input-label text-[#181c32] text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1 ${labalClass}`}
|
className={`job-label ${error && 'job-label-flex'} ${labalClass}`}
|
||||||
htmlFor={name}
|
htmlFor={name}
|
||||||
>
|
>
|
||||||
{label}
|
{label}
|
||||||
|
|||||||
@@ -64,13 +64,13 @@ function DeleteJobPopout({ details, onClose, situation }) {
|
|||||||
return (
|
return (
|
||||||
<ModalCom action={onClose} situation={situation}>
|
<ModalCom action={onClose} situation={situation}>
|
||||||
<div className="logout-modal-wrapper lg:w-[600px] bg-white dark:bg-dark-white lg:rounded-2xl">
|
<div className="logout-modal-wrapper lg:w-[600px] bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||||
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
|
<div className="modal-header-con">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="modal-title">
|
||||||
Delete Job
|
Delete Job
|
||||||
</h1>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#374557] dark:text-red-500"
|
className="modal-close-btn"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -119,10 +119,10 @@ function DeleteJobPopout({ details, onClose, situation }) {
|
|||||||
{details.title}
|
{details.title}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-lg tracking-wide text-dark-gray dark:text-white flex items-start gap-1">
|
<p className="text-lg tracking-wide text-dark-gray dark:text-white flex items-start gap-1">
|
||||||
Price: {details.thePrice}
|
<span className="job-label">Price: </span>{details.thePrice}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
|
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
|
||||||
Duration: {details.timeline_days} day(s)
|
<span className="job-label">Duration: </span>{details.timeline_days} day(s)
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex space-x-2.5">
|
<div className="flex space-x-2.5">
|
||||||
|
|||||||
@@ -212,13 +212,13 @@ const EditJobPopOut = ({
|
|||||||
return (
|
return (
|
||||||
<ModalCom action={onClose} situation={situation}>
|
<ModalCom action={onClose} situation={situation}>
|
||||||
<div className="logout-modal-wrapper w-11/12 lg:w-[600px] bg-white dark:bg-dark-white lg:rounded-2xl">
|
<div className="logout-modal-wrapper w-11/12 lg:w-[600px] bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||||
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
|
<div className="modal-header-con">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="modal-title">
|
||||||
Edit Job
|
Edit Job
|
||||||
</h1>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#374557] dark:text-red-500"
|
className="modal-close-btn"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -328,8 +328,8 @@ const EditJobPopOut = ({
|
|||||||
<div className="field flex flex-col sm:flex-row w-full mb-[5px] gap-2">
|
<div className="field flex flex-col sm:flex-row w-full mb-[5px] gap-2">
|
||||||
<div className="sm:w-[60%] w-full">
|
<div className="sm:w-[60%] w-full">
|
||||||
<label
|
<label
|
||||||
htmlFor="Job Delivery Details"
|
htmlFor="job-label"
|
||||||
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"'
|
className='job-label'
|
||||||
>
|
>
|
||||||
Job Delivery Details
|
Job Delivery Details
|
||||||
</label>
|
</label>
|
||||||
@@ -352,7 +352,7 @@ const EditJobPopOut = ({
|
|||||||
<div className="sm:w-[35%] w-full">
|
<div className="sm:w-[35%] w-full">
|
||||||
<div
|
<div
|
||||||
htmlFor="Job Categories"
|
htmlFor="Job Categories"
|
||||||
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"'
|
className='job-label'
|
||||||
id="checked-group"
|
id="checked-group"
|
||||||
>
|
>
|
||||||
Categories
|
Categories
|
||||||
@@ -422,7 +422,7 @@ const EditJobPopOut = ({
|
|||||||
<div className="field w-1/2">
|
<div className="field w-1/2">
|
||||||
<div className={`flex items-center justify-between`}>
|
<div className={`flex items-center justify-between`}>
|
||||||
<label
|
<label
|
||||||
className="w-full input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex flex-col"
|
className="job-label flex flex-col"
|
||||||
htmlFor="timeline_days"
|
htmlFor="timeline_days"
|
||||||
>
|
>
|
||||||
Timeline -
|
Timeline -
|
||||||
|
|||||||
@@ -10,7 +10,12 @@ import localImgLoad from "../../lib/localImgLoad";
|
|||||||
import { tableReload } from "../../store/TableReloads";
|
import { tableReload } from "../../store/TableReloads";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
|
|
||||||
|
import { SocketValues } from "../Contexts/SocketIOContext";
|
||||||
|
|
||||||
function FamilyOfferJobPopout({ details, onClose, situation }) {
|
function FamilyOfferJobPopout({ details, onClose, situation }) {
|
||||||
|
|
||||||
|
const {parentAssignJobToKid} = SocketValues()
|
||||||
|
|
||||||
const apiUrl = new usersService();
|
const apiUrl = new usersService();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -69,6 +74,18 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
|
|||||||
message: `Offer ${name}ed Successfully`,
|
message: `Offer ${name}ed Successfully`,
|
||||||
trigger: "",
|
trigger: "",
|
||||||
});
|
});
|
||||||
|
// trigger socket event to refresh parent side
|
||||||
|
//SENDS MESSAGE TO SOCKET TO UPDATE PARENT ACCOUNT WHEN CHILD ACCEPTS OR REJECTS A JOB ASSIGNED BY PARENT
|
||||||
|
// message, room
|
||||||
|
let socketMsg = {
|
||||||
|
"audience": "PARENT",
|
||||||
|
"action": "REFRESH_TASK",
|
||||||
|
"family_uid": sessionStorage.getItem('family_uid'),
|
||||||
|
}
|
||||||
|
let socketRoom = `FAMILY-${sessionStorage.getItem('parent_uid')}`
|
||||||
|
parentAssignJobToKid(socketMsg, socketRoom) //SENDS MESSAGE TO SOCKET TO UPDATE CHILD ACCOUNT
|
||||||
|
// end of socket event trigger
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
onClose();
|
onClose();
|
||||||
dispatch(tableReload({ type: "MYTASKTABLE" }));
|
dispatch(tableReload({ type: "MYTASKTABLE" }));
|
||||||
|
|||||||
@@ -303,13 +303,13 @@ function JobListPopout({
|
|||||||
return (
|
return (
|
||||||
<ModalCom action={onClose} situation={situation} className="">
|
<ModalCom action={onClose} situation={situation} className="">
|
||||||
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
<div className="modal-header-con">
|
||||||
<h1 className="text-base md:text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="modal-title">
|
||||||
{details.title}
|
{details.title}
|
||||||
</h1>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#374557] dark:text-red-500"
|
className="modal-close-btn"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
|
|||||||
@@ -135,13 +135,13 @@ function PendingJobsPopout({ details, onClose, situation }) {
|
|||||||
return (
|
return (
|
||||||
<ModalCom action={onClose} situation={situation}>
|
<ModalCom action={onClose} situation={situation}>
|
||||||
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
<div className="modal-header-con">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="modal-title">
|
||||||
Manage Pending Item
|
Manage Pending Item
|
||||||
</h1>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#374557] dark:text-red-500"
|
className="modal-close-btn"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -170,7 +170,7 @@ function PendingJobsPopout({ details, onClose, situation }) {
|
|||||||
<p className="text-base font-semibold text-slate-900 dark:text-white tracking-wide">
|
<p className="text-base font-semibold text-slate-900 dark:text-white tracking-wide">
|
||||||
{details.title}
|
{details.title}
|
||||||
</p>
|
</p>
|
||||||
<div className="my-2 p-2 flex justify-start items-center space-x-2 bg-red-100 border-2 border-red-300">
|
<div className="my-2 p-2 flex justify-start items-center space-x-2 bg-red-100 border-2 border-red-300 rounded-2xl">
|
||||||
<span className="w-8 h-8 text-center text-sm rounded-full flex justify-center items-center text-red-300 bg-yellow-100">
|
<span className="w-8 h-8 text-center text-sm rounded-full flex justify-center items-center text-red-300 bg-yellow-100">
|
||||||
!
|
!
|
||||||
</span>
|
</span>
|
||||||
@@ -236,7 +236,7 @@ function PendingJobsPopout({ details, onClose, situation }) {
|
|||||||
|
|
||||||
{/* ACTION SECTION */}
|
{/* ACTION SECTION */}
|
||||||
<div className="p-4 w-full md:w-1/4 h-full">
|
<div className="p-4 w-full md:w-1/4 h-full">
|
||||||
<p className="mb-6 text-sm dark:text-white">Actions</p>
|
<p className="job-label mb-6 dark:text-white">Actions</p>
|
||||||
|
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<p className="px-2 py-1 text-sm bg-slate-100">
|
<p className="px-2 py-1 text-sm bg-slate-100">
|
||||||
|
|||||||
+16
-1
@@ -154,8 +154,23 @@
|
|||||||
|
|
||||||
@layer components{
|
@layer components{
|
||||||
.job-label{
|
.job-label{
|
||||||
@apply text-slate-900 dark:text-white tracking-wide font-semibold
|
@apply text-base text-slate-900 dark:text-white tracking-wide font-semibold
|
||||||
}
|
}
|
||||||
|
.job-label-flex{
|
||||||
|
@apply flex items-center gap-2
|
||||||
|
}
|
||||||
|
|
||||||
|
/* style for all modal header */
|
||||||
|
.modal-header-con{
|
||||||
|
@apply w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] bg-sky-blue/50 border-b dark:border-[#5356fb29] border-light-purple
|
||||||
|
}
|
||||||
|
.modal-title{
|
||||||
|
@apply text-2xl leading-8 font-bold text-dark-gray dark:text-white tracking-wide flex items-center
|
||||||
|
}
|
||||||
|
.modal-close-btn{
|
||||||
|
@apply text-[#000] dark:text-red-500
|
||||||
|
}
|
||||||
|
/* end of style for all modal header */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===================== EXTRA ===================== */
|
/* ===================== EXTRA ===================== */
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const initialState = {
|
|||||||
chatMessageList: false,
|
chatMessageList: false,
|
||||||
marketTableList: false,
|
marketTableList: false,
|
||||||
familyOfferList: false,
|
familyOfferList: false,
|
||||||
|
parentFamilyTaskList: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tableReloadSlice = createSlice({
|
export const tableReloadSlice = createSlice({
|
||||||
@@ -53,6 +54,9 @@ export const tableReloadSlice = createSlice({
|
|||||||
case "FAMILYOFFERLIST":
|
case "FAMILYOFFERLIST":
|
||||||
state.familyOfferList = !state.familyOfferList;
|
state.familyOfferList = !state.familyOfferList;
|
||||||
return;
|
return;
|
||||||
|
case "PARENTFAMILYTASKLIST": // reloads list of active family task on parent side
|
||||||
|
state.parentFamilyTaskList = !state.parentFamilyTaskList;
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ function AddJobPage({ action, situation, categories }) {
|
|||||||
return (
|
return (
|
||||||
<ModalCom action={action} situation={situation}>
|
<ModalCom action={action} situation={situation}>
|
||||||
<div className="lg:w-[600px] w-11/12 lg:overflow-hidden lg:rounded-2xl bg-white dark:bg-dark-white dark:text-white">
|
<div className="lg:w-[600px] w-11/12 lg:overflow-hidden lg:rounded-2xl bg-white dark:bg-dark-white dark:text-white">
|
||||||
<div className="heading flex justify-between items-center py-6 md:px-[30px] px-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
|
<div className="modal-header-con">
|
||||||
<p className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="modal-title">
|
||||||
Create New Job
|
New Job
|
||||||
</p>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#374557] dark:text-red-500"
|
className="modal-close-btn"
|
||||||
onClick={action}
|
onClick={action}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
|
|||||||
Reference in New Issue
Block a user