Compare commits
98 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d2a406563a | |||
| d509fb024c | |||
| 4acae3401d | |||
| 05a1dc3663 | |||
| 63eb8b9729 | |||
| a474d42d85 | |||
| dcb820590d | |||
| 614c376c92 | |||
| b589277678 | |||
| 00a70f3574 | |||
| 7859cffd49 | |||
| 3a574d1fd0 | |||
| 7c6a2316a8 | |||
| ef99a8f1f7 | |||
| ba0aac126c | |||
| 05453661ee | |||
| aee1b9e3bb | |||
| 9a0dc0d01a | |||
| a467626fae | |||
| 47932d7301 | |||
| de4de35611 | |||
| b3c2785a4b | |||
| 2719b8426d | |||
| fed2358a45 | |||
| ff129480a5 | |||
| 8cf0c8da89 | |||
| 6aaf682d38 | |||
| 9f77a01bb2 | |||
| 9d79e1c709 | |||
| 78ac5d5b24 | |||
| 75657350a3 | |||
| 171f99d997 | |||
| 25c7cd75c7 | |||
| fd68800b00 | |||
| 33f1515d2c | |||
| 2cc30d6c47 | |||
| cfadb42811 | |||
| 1bb2eb3203 | |||
| cd68861dfa | |||
| 9fb0a65e46 | |||
| 15fce205a6 | |||
| dddf6af401 | |||
| 1a86361fbb | |||
| 4f69786f19 | |||
| 5634c1542b | |||
| f9e3d2aad2 | |||
| 921d1af7f0 | |||
| c98d2e41ef | |||
| ea260fa15a | |||
| b604e0b527 | |||
| 991571b2d2 | |||
| 1f98a3eacb | |||
| 031a2f6680 | |||
| bf22570857 | |||
| 89aa5e0aef | |||
| 680833d5be | |||
| 1e0af67542 | |||
| 406af95861 | |||
| 14f69d4c3b | |||
| 24f915ee55 | |||
| 5da67c4c06 | |||
| a21eaa40f2 | |||
| a00e40dbe9 | |||
| fa51914987 | |||
| c8d40c1630 | |||
| f673fe99ef | |||
| 8d5d0672cc | |||
| 09def50875 | |||
| d6920b320c | |||
| cbfaf1e073 | |||
| 3d59b36850 | |||
| f1d659b273 | |||
| ad49489377 | |||
| 386fc8cb0c | |||
| 0045a791fe | |||
| b48cb48213 | |||
| 856c70628a | |||
| fa40f8f725 | |||
| 8c475a56bb | |||
| 7ca8c23479 | |||
| 688592e1a3 | |||
| d12b949bcc | |||
| 3a219a20bb | |||
| e6bc184747 | |||
| 2a3edcf3be | |||
| a1d96488bf | |||
| 3f17920bd0 | |||
| 4014a84e1a | |||
| 60ed9e7bcf | |||
| 479ea408f6 | |||
| 9ca4ba3199 | |||
| e5fa6544a5 | |||
| f55b7186b9 | |||
| 05515333ba | |||
| 7212ab6cfc | |||
| 020154d51a | |||
| e4aadfb627 | |||
| 6a79c3e56f |
@@ -72,7 +72,8 @@ REACT_APP_APPLE_SOCIAL_LOGIN=0
|
|||||||
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
|
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
|
||||||
|
|
||||||
#File Handling
|
#File Handling
|
||||||
REACT_APP_MAX_FILE_SIZE=1000000
|
REACT_APP_MAX_FILE_SIZE=1048576
|
||||||
|
REACT_APP_MAX_VIDEO_FILE_SIZE=31457280
|
||||||
REACT_APP_TOTAL_NUM_FILE=4
|
REACT_APP_TOTAL_NUM_FILE=4
|
||||||
|
|
||||||
#Auth Text(s)
|
#Auth Text(s)
|
||||||
@@ -125,3 +126,6 @@ REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
|||||||
|
|
||||||
# REACT APP CUSTOMTIMER
|
# REACT APP CUSTOMTIMER
|
||||||
REACT_APP_CUSTOMTIMER=90
|
REACT_APP_CUSTOMTIMER=90
|
||||||
|
|
||||||
|
#SHOW OR HIDE MY PAGE LINK ROUTE
|
||||||
|
REACT_APP_SHOW_USER_PAGE=1
|
||||||
+6
-1
@@ -43,7 +43,9 @@ REACT_APP_GOOGLE_CLIENT_SECRET=aozK_2G8UjaCmLgPPkv9abIm
|
|||||||
REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
|
REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
|
||||||
REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/
|
REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/
|
||||||
|
|
||||||
REACT_APP_MAX_FILE_SIZE=1000000
|
#File Handling
|
||||||
|
REACT_APP_MAX_FILE_SIZE=1048576
|
||||||
|
REACT_APP_MAX_VIDEO_FILE_SIZE=31457280
|
||||||
REACT_APP_TOTAL_NUM_FILE=4
|
REACT_APP_TOTAL_NUM_FILE=4
|
||||||
|
|
||||||
REACT_APP_LOGOUT_TEXT="Sign Out"
|
REACT_APP_LOGOUT_TEXT="Sign Out"
|
||||||
@@ -93,3 +95,6 @@ REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
|||||||
|
|
||||||
# REACT APP CUSTOMTIMER
|
# REACT APP CUSTOMTIMER
|
||||||
REACT_APP_CUSTOMTIMER=90
|
REACT_APP_CUSTOMTIMER=90
|
||||||
|
|
||||||
|
#SHOW OR HIDE MY PAGE LINK ROUTE
|
||||||
|
REACT_APP_SHOW_USER_PAGE=1
|
||||||
+6
-1
@@ -50,7 +50,9 @@ REACT_APP_FACEBOOK_REDIRECT_URL="https://users.wrenchboard.com/login/auth/flogin
|
|||||||
|
|
||||||
DISABLE_ESLINT_PLUGIN=true
|
DISABLE_ESLINT_PLUGIN=true
|
||||||
|
|
||||||
REACT_APP_MAX_FILE_SIZE=1000000
|
#File Handling
|
||||||
|
REACT_APP_MAX_FILE_SIZE=1048576
|
||||||
|
REACT_APP_MAX_VIDEO_FILE_SIZE=31457280
|
||||||
REACT_APP_TOTAL_NUM_FILE=4
|
REACT_APP_TOTAL_NUM_FILE=4
|
||||||
|
|
||||||
REACT_APP_LOGOUT_TEXT="Sign Out"
|
REACT_APP_LOGOUT_TEXT="Sign Out"
|
||||||
@@ -99,3 +101,6 @@ REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
|||||||
|
|
||||||
# REACT APP CUSTOMTIMER
|
# REACT APP CUSTOMTIMER
|
||||||
REACT_APP_CUSTOMTIMER=90
|
REACT_APP_CUSTOMTIMER=90
|
||||||
|
|
||||||
|
#SHOW OR HIDE MY PAGE LINK ROUTE
|
||||||
|
REACT_APP_SHOW_USER_PAGE=0
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 52 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
@@ -72,21 +72,33 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// For form initial values
|
||||||
|
const initialValues = {
|
||||||
|
// initial values for formik
|
||||||
|
country: walletDetails.data.length == 1 ? walletDetails.data[0].country : '',
|
||||||
|
price: "",
|
||||||
|
title: "",
|
||||||
|
description: "",
|
||||||
|
job_detail: "",
|
||||||
|
timeline_days: "",
|
||||||
|
category: [],
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={IV}
|
initialValues={initialValues}
|
||||||
validationSchema={validationSchema}
|
validationSchema={validationSchema}
|
||||||
onSubmit={handleAddJob}
|
onSubmit={handleAddJob}
|
||||||
>
|
>
|
||||||
{(props) => {
|
{(props) => {
|
||||||
return (
|
return (
|
||||||
<Form>
|
<Form className='contents'>
|
||||||
<div className="add-job p-5 w-full bg-white dark:bg-dark-white dark:text-white rounded-md flex flex-col justify-between">
|
<div className="add-job p-5 w-full h-full rounded-md flex flex-col justify-between overflow-y-auto">
|
||||||
<div className="flex flex-col-reverse sm:flex-row">
|
<div className="flex flex-col-reverse sm:flex-row">
|
||||||
<div className="fields w-full">
|
<div className="fields w-full">
|
||||||
{/* inputs starts here */}
|
{/* inputs starts here */}
|
||||||
<div className="xl:flex xl:space-x-7 mb-[5px]">
|
<div className="xl:flex xl:space-x-7 mb-[5px]">
|
||||||
<div className="field w-full mb-6 xl:mb-0">
|
<div className="field w-full mb-[5px] xl:mb-0">
|
||||||
<label
|
<label
|
||||||
htmlFor="country"
|
htmlFor="country"
|
||||||
className="job-label job-label-flex"
|
className="job-label job-label-flex"
|
||||||
@@ -102,15 +114,16 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
id="country"
|
id="country"
|
||||||
name="country"
|
name="country"
|
||||||
value={props.values.country}
|
value={props.values.country}
|
||||||
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none border`}
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
onChange={props.handleChange}
|
onChange={props.handleChange}
|
||||||
onBlur={props.handleBlur}
|
onBlur={props.handleBlur}
|
||||||
|
disabled={walletDetails.data.length == 1}
|
||||||
>
|
>
|
||||||
{walletDetails?.loading ? (
|
{walletDetails?.loading ? (
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
Loading...
|
Loading...
|
||||||
</option>
|
</option>
|
||||||
) : walletDetails.data.length ? (
|
) : walletDetails.data.length > 1 ? (
|
||||||
<>
|
<>
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
Select a currency
|
Select a currency
|
||||||
@@ -125,7 +138,19 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : walletDetails.data.length == 1 ?
|
||||||
|
<>
|
||||||
|
{walletDetails.data?.map((item, index) => (
|
||||||
|
<option
|
||||||
|
key={index}
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value={item?.country}
|
||||||
|
>
|
||||||
|
{item?.description}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
:(
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
No Options Found! Try Again
|
No Options Found! Try Again
|
||||||
</option>
|
</option>
|
||||||
@@ -134,7 +159,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Price */}
|
{/* Price */}
|
||||||
<div className="field w-full">
|
<div className="field w-full mb-[5px] xl:mb-0">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6 text-right flex"
|
fieldClass="px-6 text-right flex"
|
||||||
label="Price"
|
label="Price"
|
||||||
@@ -152,6 +177,42 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Timeline */}
|
||||||
|
<div className="field w-full mb-[5px] xl:mb-0">
|
||||||
|
<label
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
htmlFor="timeline_days"
|
||||||
|
>
|
||||||
|
Timeline
|
||||||
|
<span className="text-green-700 text-[12px] tracking-wide">
|
||||||
|
- Duration
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
component="select"
|
||||||
|
name="timeline_days"
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border ${
|
||||||
|
props.errors.timeline_days &&
|
||||||
|
props.touched.timeline_days
|
||||||
|
? "border-[#ff0a0a63] shadow-red-500 animate-shake"
|
||||||
|
: "dark:border-[#5e6278]"
|
||||||
|
}`}
|
||||||
|
value={props.values.timeline_days}
|
||||||
|
>
|
||||||
|
<option value="" className='text-slate-500 text-lg'>Select Duration</option>
|
||||||
|
{publicArray.map(({ name, duration }, idx) => (
|
||||||
|
<option
|
||||||
|
key={idx}
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value={duration}
|
||||||
|
>
|
||||||
|
{name}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</Field>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Title */}
|
{/* Title */}
|
||||||
@@ -263,7 +324,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<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="job-label"
|
className="job-label"
|
||||||
@@ -298,7 +359,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</Field>
|
</Field>
|
||||||
</div>
|
</div> */}
|
||||||
{/* inputs ends here */}
|
{/* inputs ends here */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,14 +18,14 @@ export default function LoginLayout({ slogan, children }) {
|
|||||||
backgroundImage: `url(${countryMode == "NG" ? bgImgNig : bgImgCom})`,
|
backgroundImage: `url(${countryMode == "NG" ? bgImgNig : bgImgCom})`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className={`w-full grid grid-cols-1 lg:grid-cols-2`}>
|
<div className={`w-full grid grid-cols-1 xl:grid-cols-2`}>
|
||||||
{/* <div
|
{/* <div
|
||||||
className={`auth-bg hidden lg:block bg-blue-50 relative bg-cover bg-no-repeat border-0 after:content-[''] after:absolute after:inset-0`}
|
className={`auth-bg hidden xl:block bg-blue-50 relative bg-cover bg-no-repeat border-0 after:content-[''] after:absolute after:inset-0`}
|
||||||
style={{backgroundImage: `url(${bgImg})`}}
|
style={{backgroundImage: `url(${bgImg})`}}
|
||||||
>
|
>
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className="p-5 sm:p-7 flex place-content-center lg:col-start-2">
|
<div className="p-5 sm:p-7 flex place-content-center xl:col-start-2">
|
||||||
<div className="py-5 w-full sm:w-11/12 max-w-[550px] shadow-md bg-slate-50 rounded-[0.475rem]">
|
<div className="py-5 w-full sm:w-11/12 max-w-[550px] shadow-md bg-slate-50 dark:bg-dark-white rounded-[0.475rem]">
|
||||||
<div className="w-full flex justify-center items-center">
|
<div className="w-full flex justify-center items-center">
|
||||||
{children && children}
|
{children && children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ export default function Login() {
|
|||||||
localStorage.setItem("member_id", `${res.data.member_id}`);
|
localStorage.setItem("member_id", `${res.data.member_id}`);
|
||||||
localStorage.setItem("uid", `${res.data.uid}`);
|
localStorage.setItem("uid", `${res.data.uid}`);
|
||||||
localStorage.setItem("session_token", `${res.data.session}`);
|
localStorage.setItem("session_token", `${res.data.session}`);
|
||||||
|
localStorage.setItem("wallet_available_status", `${res.data.wallet_available_status}`);
|
||||||
if (res.data?.account_type == "FAMILY") {
|
if (res.data?.account_type == "FAMILY") {
|
||||||
sessionStorage.setItem("family_uid", res.data?.family_uid);
|
sessionStorage.setItem("family_uid", res.data?.family_uid);
|
||||||
sessionStorage.setItem("parent_uid", res.data?.parent_uid);
|
sessionStorage.setItem("parent_uid", res.data?.parent_uid);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useEffect, useState } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text_new.png";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import AuthLayout from "../AuthLayout2";
|
import AuthLayout from "../AuthLayout2";
|
||||||
@@ -180,11 +180,11 @@ export default function SignUp() {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full flex items-center gap-2">
|
<div className="w-full flex items-center gap-2">
|
||||||
<div className="border-b border-[#eff2f5] max-w-[50%] w-full"></div>
|
<div className="border-b border-[#eff2f5] w-[48%]"></div>
|
||||||
<span className="text-[#b5b5c3] font-medium text-[0.7rem] w-[2%]">
|
<span className="text-[#b5b5c3] font-medium text-[0.7rem]">
|
||||||
OR
|
OR
|
||||||
</span>
|
</span>
|
||||||
<div className="border-b border-[#eff2f5] max-w-[50%] w-full"></div>
|
<div className="border-b border-[#eff2f5] w-[48%]"></div>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-area">
|
<div className="input-area">
|
||||||
<SelectOption
|
<SelectOption
|
||||||
@@ -413,7 +413,7 @@ const SelectOption = ({
|
|||||||
disabled={disable}
|
disabled={disable}
|
||||||
name={name}
|
name={name}
|
||||||
id={name}
|
id={name}
|
||||||
className="input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base focus-visible:border-transparent focus-visible:outline-0 focus-visible:ring-transparent "
|
className="px-6 input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-dark-gray bg-[#f5f8fa] dark:bg-[#FAFAFA] text-base focus-visible:border-transparent focus-visible:outline-0 focus-visible:ring-transparent "
|
||||||
onChange={inputHandler}
|
onChange={inputHandler}
|
||||||
value={value}
|
value={value}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import debounce from "../../../hooks/debounce";
|
|||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import AuthLayout from "../AuthLayout2";
|
import AuthLayout from "../AuthLayout2";
|
||||||
|
import LoadingSpinner from '../../../components/Spinners/LoadingSpinner'
|
||||||
|
|
||||||
export default function VerifyLink() {
|
export default function VerifyLink() {
|
||||||
const [email, setEmail] = useState("");
|
const [email, setEmail] = useState("");
|
||||||
@@ -119,7 +120,14 @@ export default function VerifyLink() {
|
|||||||
<>
|
<>
|
||||||
<AuthLayout slogan="Welcome to WrenchBoard">
|
<AuthLayout slogan="Welcome to WrenchBoard">
|
||||||
{pageLoader ? (
|
{pageLoader ? (
|
||||||
<img src={WrenchBoard} alt="wrenchboard" className="h-10 mx-auto" />
|
<div className='flex flex-col justify-center items-center gap-4'>
|
||||||
|
<img src={WrenchBoard} alt="wrenchboard" className="h-10 mx-auto" />
|
||||||
|
<div className='flex flex-col justify-center items-center'>
|
||||||
|
<LoadingSpinner height='h-40' size='8' />
|
||||||
|
<p>Loading...</p>
|
||||||
|
<p>please do not refresh</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-12">
|
<div className="mb-12">
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default function AvailableJobsCard({
|
|||||||
<>
|
<>
|
||||||
{contentDisplay == "grid" ? (
|
{contentDisplay == "grid" ? (
|
||||||
<div
|
<div
|
||||||
className={`card-style-two w-full h-[426px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
className={`card-style-two w-full p-[10px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
||||||
className || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
@@ -42,50 +42,56 @@ export default function AvailableJobsCard({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setMarketPopUp({ show: true, data: datas });
|
setMarketPopUp({ show: true, data: datas });
|
||||||
}}
|
}}
|
||||||
className="flex flex-col justify-between w-full h-full"
|
className="flex flex-col gap-2 justify-between w-full h-full"
|
||||||
>
|
>
|
||||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
<div className='w-full flex items-center gap-4'>
|
||||||
{datas.title}
|
<div className='min-w-[60px] min-h-[60px] max-w-[60px] max-h-[60px] rounded-full overflow-hidden'>
|
||||||
</h1>
|
<img className='w-full h-full object-cover' src={image} alt='Job Image' />
|
||||||
|
|
||||||
<div className="card-two-info flex justify-between items-center">
|
|
||||||
<div className="owned-by flex space-x-2 items-center">
|
|
||||||
<div>
|
|
||||||
<p className="text-thin-light-gray text-sm leading-3">
|
|
||||||
Added
|
|
||||||
</p>
|
|
||||||
<p className="text-base text-dark-gray dark:text-white">
|
|
||||||
{new Date(datas.offer_added).toLocaleDateString()}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
|
<div className='w-full'>
|
||||||
<div className="created-by flex space-x-2 items-center flex-row-reverse">
|
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||||
<div>
|
{datas.title}
|
||||||
<p className="text-thin-light-gray text-sm leading-3 text-right">
|
</h1>
|
||||||
Expires
|
|
||||||
</p>
|
<div className="card-two-info flex justify-between items-center">
|
||||||
<p className="text-base text-dark-gray dark:text-white text-right">
|
<div className="owned-by flex space-x-2 items-center">
|
||||||
{new Date(datas.expire).toLocaleDateString()}
|
<div>
|
||||||
</p>
|
<p className="text-thin-light-gray text-sm leading-3">
|
||||||
|
Added
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-dark-gray dark:text-white">
|
||||||
|
{new Date(datas.offer_added).toLocaleDateString()}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
|
||||||
|
<div className="created-by flex space-x-2 items-center flex-row-reverse">
|
||||||
|
<div>
|
||||||
|
<p className="text-thin-light-gray text-sm leading-3 text-right">
|
||||||
|
Expires
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-dark-gray dark:text-white text-right">
|
||||||
|
{new Date(datas.expire).toLocaleDateString()}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="thumbnail-area w-full">
|
<div className="thumbnail-area w-full">
|
||||||
<div
|
<div
|
||||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden bg-center bg-cover bg-no-repeat"
|
className="w-full h-[236px] rounded-xl overflow-y-auto bg-center bg-cover bg-no-repeat"
|
||||||
style={{
|
// style={{
|
||||||
backgroundImage: `url('${image}')`,
|
// backgroundImage: `url('${image}')`,
|
||||||
}}
|
// }}
|
||||||
>
|
>
|
||||||
<div className="flex justify-center bg-slate-100 p-2 rounded-md">
|
<div className="flex flex-col h-full bg-slate-100 p-2 rounded-md">
|
||||||
{datas.description}
|
<p>{datas.description}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="details-area">
|
<div className="details-area">
|
||||||
<div className="product-two-options flex justify-between mb-5 relative"></div>
|
{/* <div className="product-two-options flex justify-between mb-5 relative"></div> */}
|
||||||
|
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const AccountDashboard = ({ className, bannerList }) => {
|
|||||||
{getLowerBanner?.map((props, idx) => {
|
{getLowerBanner?.map((props, idx) => {
|
||||||
let image = getImage(props);
|
let image = getImage(props);
|
||||||
|
|
||||||
let { short_title, short_description, short_button_text, link_path } =
|
let { short_title, short_description, short_button_text, link_path, card_type, blog_id } =
|
||||||
props;
|
props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -56,6 +56,8 @@ const AccountDashboard = ({ className, bannerList }) => {
|
|||||||
title={short_title}
|
title={short_title}
|
||||||
desc={short_description}
|
desc={short_description}
|
||||||
link_path={link_path}
|
link_path={link_path}
|
||||||
|
card_type={card_type}
|
||||||
|
blog_id={blog_id}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -102,24 +104,26 @@ const TopBanner = ({ image, title = "", desc = "", btn, link_path, key }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const LowerBanner = ({ image, title = "", desc = "", btn, link_path, key }) => {
|
const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type, blog_id, key }) => {
|
||||||
|
const newLinkPath = card_type == 'BLOG' ? `${link_path}?blog_id=${blog_id}` : link_path
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={key}
|
key={key}
|
||||||
className="flex flex-col bg-white shadow-md h-full rounded-xl dark:border-[#5356fb29] dark:bg-dark-white"
|
className="flex flex-col bg-white shadow-md h-full rounded-xl dark:border-[#5356fb29] dark:bg-dark-white"
|
||||||
>
|
>
|
||||||
<div className="w-full flex justify-between border-b border-slate-300 p-2">
|
<div className="w-full xxs:flex justify-between items-center border-b border-slate-300 p-2">
|
||||||
<div className="h-[130px] flex justify-between items-center">
|
<div className="min-h-[150px] sm:min-h-[130px] flex justify-between items-center">
|
||||||
<div className="px-2 flex flex-col gap-2 dark:text-white">
|
<div className="px-2 flex flex-col gap-2 dark:text-white">
|
||||||
<Link to={link_path} className="text-lg font-bold">
|
<Link to={newLinkPath} className="text-lg font-bold">
|
||||||
{title}
|
{title}
|
||||||
</Link>
|
</Link>
|
||||||
<p to={link_path} className="text-sm">
|
<p to={newLinkPath} className="text-sm">
|
||||||
{desc}
|
{desc}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Link to={link_path} className="w-[150px] h-[100px]">
|
<Link to={newLinkPath} className="w-[150px] h-[100px]">
|
||||||
<img
|
<img
|
||||||
src={image}
|
src={image}
|
||||||
alt="banner-img"
|
alt="banner-img"
|
||||||
@@ -129,7 +133,7 @@ const LowerBanner = ({ image, title = "", desc = "", btn, link_path, key }) => {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between w-full px-2 items-center">
|
<div className="flex justify-between w-full px-2 items-center">
|
||||||
<Link to={link_path} className="text-slate-300 font-semibold text-sm">
|
<Link to={newLinkPath} className="text-slate-300 font-semibold text-sm">
|
||||||
{btn}
|
{btn}
|
||||||
</Link>
|
</Link>
|
||||||
<button className="flex items-center justify-center gap-2">
|
<button className="flex items-center justify-center gap-2">
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ export default function FamilyManageTabs({
|
|||||||
familyData={familyWaitList}
|
familyData={familyWaitList}
|
||||||
accountDetails={accountDetails}
|
accountDetails={accountDetails}
|
||||||
setUpdatePage={setUpdatePage}
|
setUpdatePage={setUpdatePage}
|
||||||
|
jobList={jobList}
|
||||||
|
setActiveTask={setActiveTask}
|
||||||
|
activeTask={activeTask}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
Pending: (
|
Pending: (
|
||||||
|
|||||||
@@ -85,13 +85,13 @@ export default function AssignMediaTask({
|
|||||||
>
|
>
|
||||||
{(props) => {
|
{(props) => {
|
||||||
return (
|
return (
|
||||||
<Form>
|
<Form className='contents'>
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={`job-action-modal-body w-full min-h-[450px] max-h-[450px] overflow-y-auto md:grid md:grid-cols-2`}
|
className={`job-action-modal-body w-full h-full overflow-y-auto md:grid md:grid-cols-2`}
|
||||||
>
|
>
|
||||||
<div className="p-4 pt-0">
|
<div className="p-4 pt-0">
|
||||||
<div className="p-4 w-full min-h-[410px] max-h-[410px] overflow-y-auto bg-slate-100 rounded-md dark:bg-[#11131f] dark:text-white">
|
<div className="p-4 w-full h-[450px] overflow-y-auto bg-slate-100 rounded-md dark:bg-[#11131f] dark:text-white">
|
||||||
{commonMedia?.data?.length ? (
|
{commonMedia?.data?.length ? (
|
||||||
commonMedia?.data?.map((item, index) => (
|
commonMedia?.data?.map((item, index) => (
|
||||||
<div
|
<div
|
||||||
@@ -124,7 +124,7 @@ export default function AssignMediaTask({
|
|||||||
{/*Right Hand Side for details && Task Type === select */}
|
{/*Right Hand Side for details && Task Type === select */}
|
||||||
<>
|
<>
|
||||||
{commonMedia?.data?.length > 0 ? (
|
{commonMedia?.data?.length > 0 ? (
|
||||||
<div className="p-4 py-0 h-full">
|
<div className="p-4 py-0 h-auto">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-3 w-full">
|
<div className="mb-3 w-full">
|
||||||
<label className="job-label">
|
<label className="job-label">
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import LoadingSpinner from '../../Spinners/LoadingSpinner'
|
|||||||
import { NewTasks } from './forms'
|
import { NewTasks } from './forms'
|
||||||
import { PriceFormatter } from '../../Helpers/PriceFormatter'
|
import { PriceFormatter } from '../../Helpers/PriceFormatter'
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
import AttachFile from '../../attachmentCom/AttachFile';
|
||||||
|
|
||||||
export default function AssignPrevNewTask({
|
export default function AssignPrevNewTask({
|
||||||
jobList,
|
jobList,
|
||||||
@@ -21,7 +22,7 @@ export default function AssignPrevNewTask({
|
|||||||
|
|
||||||
|
|
||||||
let imageSrc = (localStorage.getItem("session_token")
|
let imageSrc = (localStorage.getItem("session_token")
|
||||||
? `${userDetails?.session_image_server}${localStorage.getItem("session_token")}/job/${activeTask.data.job_uid}` : ""); // FOR GETTING JOB IMAGE
|
? `${userDetails?.session_image_server}${localStorage.getItem("session_token")}/job/${activeTask?.data?.job_uid}` : ""); // FOR GETTING JOB IMAGE
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -32,7 +33,7 @@ export default function AssignPrevNewTask({
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={`job-action-modal-body w-full min-h-[450px] max-h-[450px] overflow-y-auto md:grid ${
|
className={`job-action-modal-body w-full h-full overflow-y-auto md:grid ${
|
||||||
taskType !== "new" ? "md:grid-cols-2" : "md:grid-cols-1"
|
taskType !== "new" ? "md:grid-cols-2" : "md:grid-cols-1"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
@@ -63,7 +64,7 @@ export default function AssignPrevNewTask({
|
|||||||
</div>
|
</div>
|
||||||
{/* Task Type === select */}
|
{/* Task Type === select */}
|
||||||
{taskType == "select" && (
|
{taskType == "select" && (
|
||||||
<div className="p-4 w-full h-[400px] overflow-y-auto bg-slate-100 rounded-md dark:bg-[#11131f] dark:text-white">
|
<div className="p-4 w-full h-[450px] overflow-y-auto bg-slate-100 rounded-md dark:bg-[#11131f] dark:text-white">
|
||||||
{jobList?.data?.length ? (
|
{jobList?.data?.length ? (
|
||||||
jobList?.data?.map((item, index) => (
|
jobList?.data?.map((item, index) => (
|
||||||
<div
|
<div
|
||||||
@@ -120,68 +121,67 @@ export default function AssignPrevNewTask({
|
|||||||
value={activeTask?.data?.description}
|
value={activeTask?.data?.description}
|
||||||
/>
|
/>
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className="my-3 w-full">
|
<div className='flex flex-col gap-2'>
|
||||||
<label className="job-label">
|
<div className="my-1 w-full">
|
||||||
Description
|
<label className="job-label">
|
||||||
</label>
|
Description
|
||||||
<p className="p-1 text-sm text-slate-900 dark:text-white max-h-[100px] overflow-y-auto">
|
</label>
|
||||||
{activeTask?.data?.description}
|
<p className="p-1 text-sm text-slate-900 dark:text-white max-h-[100px] overflow-y-auto">
|
||||||
</p>
|
{activeTask?.data?.description}
|
||||||
</div>
|
</p>
|
||||||
<div className="grid grid-cols-2">
|
</div>
|
||||||
<div className="w-full">
|
<div className="w-full 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="w-full flex items-center gap-1">
|
||||||
Reward
|
<label className="job-label">
|
||||||
</label>
|
Reward
|
||||||
<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="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="mb-1 w-24 max-h-24 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>
|
||||||
<div className="w-full flex items-center justify-center">
|
|
||||||
<div className="w-28 h-28 rounded-2xl flex items-center justify-center">
|
{/* ATTACHMENT SECTION*/}
|
||||||
<img
|
<div className="w-full max-h-28">
|
||||||
className="w-full h-auto"
|
<AttachFile data={activeTask.data} />
|
||||||
loading="lazy"
|
|
||||||
src={imageSrc}
|
|
||||||
alt='job image'
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Dummy, no value found for created! thus commented*/}
|
<div className="my-3">
|
||||||
{/* <div className="my-3 sm:flex items-center">
|
<label className="w-full job-label">
|
||||||
<Detail
|
Delivery Detail
|
||||||
label="Created"
|
</label>
|
||||||
value={`Dummy, no value found for created!`}
|
<textarea
|
||||||
/>
|
className={`p-1 w-full text-sm text-slate-900 dark:text-white bg-transparent outline-none border border-slate-300 rounded-md`}
|
||||||
</div> */}
|
rows="5"
|
||||||
|
style={{ resize: "none" }}
|
||||||
<div className="my-3">
|
value={activeTask?.data?.job_detail}
|
||||||
<label className="w-full job-label">
|
readOnly
|
||||||
Delivery Detail
|
// onChange={handleInputChange}
|
||||||
</label>
|
/>
|
||||||
<textarea
|
</div>
|
||||||
className={`p-1 w-full text-sm text-slate-900 dark:text-white bg-transparent outline-none border border-slate-300 rounded-md`}
|
|
||||||
rows="5"
|
|
||||||
style={{ resize: "none" }}
|
|
||||||
value={activeTask?.data?.job_detail}
|
|
||||||
readOnly
|
|
||||||
// onChange={handleInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -230,9 +230,9 @@ export default function AssignPrevNewTask({
|
|||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={requestStatus.loading}
|
disabled={requestStatus.loading || requestStatus.status}
|
||||||
onClick={assignFamilyTask}
|
onClick={assignFamilyTask}
|
||||||
className="custom-btn btn-gradient text-white"
|
className={`custom-btn btn-gradient text-white ${requestStatus.status && 'opacity-50'}`}
|
||||||
>
|
>
|
||||||
Assign
|
Assign
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ const AssignTaskPopout = ({
|
|||||||
setActiveTask,
|
setActiveTask,
|
||||||
setUpdatePage,
|
setUpdatePage,
|
||||||
}) => {
|
}) => {
|
||||||
|
const newJobList = {...jobList, data:jobList?.data?.filter(item => item?.job_mode == 'FAMILY')}
|
||||||
|
|
||||||
const {parentAssignJobToKid} = SocketValues()
|
const {parentAssignJobToKid} = SocketValues()
|
||||||
|
|
||||||
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||||
@@ -311,7 +313,7 @@ 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="modal-container">
|
||||||
<div className="modal-header-con">
|
<div className="modal-header-con">
|
||||||
<h1 className="modal-title">
|
<h1 className="modal-title">
|
||||||
{details ? (
|
{details ? (
|
||||||
@@ -364,7 +366,7 @@ const AssignTaskPopout = ({
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-body">
|
<div className="modal-body-wrapper p-[0!important]">
|
||||||
<div className="px-4 py-2 w-full flex items-center gap-4">
|
<div className="px-4 py-2 w-full flex items-center gap-4">
|
||||||
<button
|
<button
|
||||||
name='task'
|
name='task'
|
||||||
@@ -383,10 +385,10 @@ const AssignTaskPopout = ({
|
|||||||
Media
|
Media
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="contents">
|
||||||
{assignType == 'task' ?
|
{assignType == 'task' ?
|
||||||
<AssignPrevNewTask
|
<AssignPrevNewTask
|
||||||
jobList={jobList}
|
jobList={newJobList}
|
||||||
requestStatus={requestStatus}
|
requestStatus={requestStatus}
|
||||||
assignFamilyTask={assignFamilyTask}
|
assignFamilyTask={assignFamilyTask}
|
||||||
taskType={taskType}
|
taskType={taskType}
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ const FamilyAccount = forwardRef(({ familyData, myRef, handlePrint}, ref) => {
|
|||||||
<div className="update-table w-full lg:min-h-[450px] h-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ">
|
<div className="update-table w-full lg:min-h-[450px] h-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ">
|
||||||
<div className="flex items-center justify-around h-[380px]">
|
<div className="flex items-center justify-around h-[380px]">
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
|
<h2 className="print:block hidden font-bold text-lg tracking-wide text-dark-gray dark:text-white capitalize mb-10">
|
||||||
|
Firstname: {familyData?.data?.firstname ? familyData?.data?.firstname : "please wait..."}
|
||||||
|
</h2>
|
||||||
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||||
Username:{" "}
|
Username:{" "}
|
||||||
<span className="ml-2 normal-case">
|
<span className="ml-2 normal-case">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
|||||||
import AssignTaskPopout from "../FamilyPopout/AssignTaskPopout";
|
import AssignTaskPopout from "../FamilyPopout/AssignTaskPopout";
|
||||||
|
|
||||||
const FamilyWaitlist = memo(
|
const FamilyWaitlist = memo(
|
||||||
({ familyData, className, accountDetails, setUpdatePage }) => {
|
({ familyData, className, accountDetails, setUpdatePage, jobList, setActiveTask, activeTask }) => {
|
||||||
const [popUp, setPopUp] = useState({ show: false, data: {} });
|
const [popUp, setPopUp] = useState({ show: false, data: {} });
|
||||||
const [continueTaskPopup, setContinueTaskPopup] = useState({
|
const [continueTaskPopup, setContinueTaskPopup] = useState({
|
||||||
show: false,
|
show: false,
|
||||||
@@ -73,7 +73,7 @@ const FamilyWaitlist = memo(
|
|||||||
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
||||||
key={value.uid}
|
key={value.uid}
|
||||||
>
|
>
|
||||||
<td className="py-4">
|
<td className="px-2 py-4">
|
||||||
<div className="w-full flex justify-between items-center">
|
<div className="w-full flex justify-between items-center">
|
||||||
<div className="account-name flex space-x-4 items-center">
|
<div className="account-name flex space-x-4 items-center">
|
||||||
<div className="icon w-14 h-14 flex justify-center items-center">
|
<div className="icon w-14 h-14 flex justify-center items-center">
|
||||||
@@ -92,23 +92,40 @@ const FamilyWaitlist = memo(
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="px-2 flex flex-col items-center justify-center">
|
{/* <div className="px-2 flex flex-col items-center justify-center">
|
||||||
<p className="text-sm font-bold text-dark-gray dark:text-white">
|
<p className="text-sm font-bold text-dark-gray dark:text-white">
|
||||||
{addedDate}
|
{addedDate}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-xs py-1.5 w-[70px] cursor-default tracking-wide rounded-full bg-gold text-white flex justify-center items-center">
|
<p className="text-xs py-1.5 w-[70px] cursor-default tracking-wide rounded-full bg-gold text-white flex justify-center items-center">
|
||||||
{value.status_text}
|
{value.status_text}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-right py-4 px-2">
|
<td className="text-right px-2 py-4">
|
||||||
<button
|
<div className='w-full flex justify-end items-center gap-4'>
|
||||||
onClick={() => openPopUp(value)}
|
<p className="text-xs py-1.5 w-[70px] cursor-default tracking-wide rounded-full bg-gold text-white flex justify-center items-center">
|
||||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
{value.status_text}
|
||||||
>
|
</p>
|
||||||
View
|
<button
|
||||||
</button>
|
onClick={() => openPopUp(value)}
|
||||||
|
className="w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 11 20"
|
||||||
|
id="Arrow"
|
||||||
|
className="w-[0.7rem]"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fillRule="evenodd"
|
||||||
|
d="M.366 19.708c.405.39 1.06.39 1.464 0l8.563-8.264a1.95 1.95 0 0 0 0-2.827L1.768.292A1.063 1.063 0 0 0 .314.282a.976.976 0 0 0-.011 1.425l7.894 7.617a.975.975 0 0 1 0 1.414L.366 18.295a.974.974 0 0 0 0 1.413"
|
||||||
|
// fill=""
|
||||||
|
className="color000000 svgShape fill-[#fff]"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
@@ -144,6 +161,9 @@ const FamilyWaitlist = memo(
|
|||||||
action={closeContinueTaskPopup}
|
action={closeContinueTaskPopup}
|
||||||
situation={continueTaskPopup.show}
|
situation={continueTaskPopup.show}
|
||||||
setUpdatePage={setUpdatePage}
|
setUpdatePage={setUpdatePage}
|
||||||
|
jobList={jobList}
|
||||||
|
setActiveTask={setActiveTask}
|
||||||
|
activeTask={activeTask}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -95,8 +95,7 @@ export default function InputCom({
|
|||||||
value={value}
|
value={value}
|
||||||
onChange={inputHandler}
|
onChange={inputHandler}
|
||||||
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${
|
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${
|
||||||
inputBg ? inputBg : "bg-[#FAFAFA] dark:bg-[#11131F] dark:text-white tracking-wide"
|
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
||||||
} focus:ring-0 focus:outline-none ${fieldClass}`}
|
|
||||||
type={type}
|
type={type}
|
||||||
id={name}
|
id={name}
|
||||||
name={name}
|
name={name}
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export default function ModalCom({ action, children, situation, isOpen, classNam
|
|||||||
<div className="modal-com">
|
<div className="modal-com">
|
||||||
<div
|
<div
|
||||||
onClick={action || isOpen}
|
onClick={action || isOpen}
|
||||||
className="fixed top-0 left-0 w-full lg:h-[100vh] h-full bg-black bg-opacity-40 backdrop-filter backdrop-blur-sm z-50"
|
className="fixed top-0 left-0 bottom-0 w-full bg-black bg-opacity-40 backdrop-filter backdrop-blur-sm z-50"
|
||||||
></div>
|
></div>
|
||||||
<div className={`fixed lg:h-100vh h-full z-[99999999999999] w-full lg:w-auto inset-0 flex flex-col justify-center items-center ${className}`}>
|
<div className={`fixed h-full z-[99999999999999] w-full lg:w-auto inset-0 flex flex-col justify-center items-center ${className}`}>
|
||||||
{children && children}
|
{children && children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, {useEffect, useState} from 'react'
|
import React, {memo, useCallback, useEffect, useState} from 'react'
|
||||||
import Image from '../../assets/images/taskbanners/default.jpg'
|
import Image from '../../assets/images/taskbanners/default.jpg'
|
||||||
|
|
||||||
import usersService from '../../services/UsersService';
|
import usersService from '../../services/UsersService';
|
||||||
@@ -9,8 +9,8 @@ import LoadingSpinner from '../Spinners/LoadingSpinner';
|
|||||||
|
|
||||||
import { AmountTo2DP } from '../Helpers/PriceFormatter';
|
import { AmountTo2DP } from '../Helpers/PriceFormatter';
|
||||||
|
|
||||||
function RewardsTable() {
|
|
||||||
|
|
||||||
|
export const RewardsTable = memo(() => {
|
||||||
const apiCall = new usersService()
|
const apiCall = new usersService()
|
||||||
|
|
||||||
let [familyRewardHistory, setFamilyRewardHistory] = useState({ // FOR PURCHASE HISTORY
|
let [familyRewardHistory, setFamilyRewardHistory] = useState({ // FOR PURCHASE HISTORY
|
||||||
@@ -30,7 +30,7 @@ function RewardsTable() {
|
|||||||
|
|
||||||
|
|
||||||
//FUNCTION TO GET FAMILY REWARD HISTORY
|
//FUNCTION TO GET FAMILY REWARD HISTORY
|
||||||
const getFamilyRewardHistory = ()=>{
|
const getFamilyRewardHistory = useCallback(()=>{
|
||||||
apiCall.getFamilyRewardHx().then((res)=>{
|
apiCall.getFamilyRewardHx().then((res)=>{
|
||||||
if(res.data.internal_return < 0){ // success but no data
|
if(res.data.internal_return < 0){ // success but no data
|
||||||
setFamilyRewardHistory(prev => ({...prev, loading: false}))
|
setFamilyRewardHistory(prev => ({...prev, loading: false}))
|
||||||
@@ -40,7 +40,7 @@ function RewardsTable() {
|
|||||||
}).catch((error)=>{
|
}).catch((error)=>{
|
||||||
setFamilyRewardHistory(prev => ({...prev, loading: false, error: true}))
|
setFamilyRewardHistory(prev => ({...prev, loading: false, error: true}))
|
||||||
})
|
})
|
||||||
}
|
},[])
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
getFamilyRewardHistory()
|
getFamilyRewardHistory()
|
||||||
@@ -99,5 +99,5 @@ function RewardsTable() {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
)
|
||||||
export default RewardsTable
|
export default RewardsTable
|
||||||
@@ -13,11 +13,15 @@ import LoadingSpinner from "../Spinners/LoadingSpinner";
|
|||||||
import RewardsTable from "./RewardsTable";
|
import RewardsTable from "./RewardsTable";
|
||||||
import JobsCompleted from "./JobsCompleted";
|
import JobsCompleted from "./JobsCompleted";
|
||||||
|
|
||||||
|
import TabButton from "../customTabs/TabButton";
|
||||||
|
|
||||||
export default function History() {
|
export default function History() {
|
||||||
|
|
||||||
const apiCall = new usersService()
|
const apiCall = new usersService()
|
||||||
|
|
||||||
let [tab, setTab] = useState("purchases"); //STATE FOR SWITCHING BETWEEN TABS
|
let [tab, setTab] = useState("purchases"); //STATE FOR SWITCHING BETWEEN TABS
|
||||||
|
const [selectedTab, setSelectedTab] = useState("purchases");
|
||||||
|
const tabs = ["purchases", "recent activity", "rewards", 'jobs completed'] //STATE FOR SWITCHING BETWEEN TABS
|
||||||
|
|
||||||
let [paymentHistory, setPaymentHistory] = useState({ // FOR PAYMENT HISTORY
|
let [paymentHistory, setPaymentHistory] = useState({ // FOR PAYMENT HISTORY
|
||||||
loading: true,
|
loading: true,
|
||||||
@@ -222,7 +226,18 @@ export default function History() {
|
|||||||
{/* <TopHxBox className="mb-11" /> */}
|
{/* <TopHxBox className="mb-11" /> */}
|
||||||
<div className='w-full p-4 md:p-8 bg-white dark:bg-dark-white rounded-2xl shadow bottomMargin'>
|
<div className='w-full p-4 md:p-8 bg-white dark:bg-dark-white rounded-2xl shadow bottomMargin'>
|
||||||
{/* switch button */}
|
{/* switch button */}
|
||||||
<div className="pl-7 my-2 flex items-center border-b border-slate-300 gap-3">
|
<div className="grid grid-cols-4 mt-4">
|
||||||
|
{tabs.map((item) => (
|
||||||
|
<TabButton
|
||||||
|
key={item}
|
||||||
|
item={item}
|
||||||
|
selectedTab={selectedTab}
|
||||||
|
setSelectedTab={setSelectedTab}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
{/* switch button */}
|
||||||
|
{/* <div className="pl-7 my-2 flex items-center border-b border-slate-300 gap-3">
|
||||||
<button
|
<button
|
||||||
name="purchases"
|
name="purchases"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onClick={(e) => setTab(e.target.name)}
|
||||||
@@ -259,12 +274,12 @@ export default function History() {
|
|||||||
>
|
>
|
||||||
Jobs Completed
|
Jobs Completed
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div> */}
|
||||||
{/* END OF switch button */}
|
{/* END OF switch button */}
|
||||||
<div className="history-tables w-full">
|
<div className="history-tables w-full bg-red-50 overflow-x-auto">
|
||||||
{/* PURCHASE SECTION */}
|
{/* PURCHASE SECTION */}
|
||||||
{tab == 'purchases' &&
|
{selectedTab == 'purchases' &&
|
||||||
<div className="wallet w-full border-t">
|
<div className="wallet w-full">
|
||||||
{/* <h1 className="p-2 text-xl font-bold text-dark-gray dark:text-white tracking-wide">Purchases</h1> */}
|
{/* <h1 className="p-2 text-xl font-bold text-dark-gray dark:text-white tracking-wide">Purchases</h1> */}
|
||||||
{purchaseHistory.loading ?
|
{purchaseHistory.loading ?
|
||||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
@@ -276,8 +291,8 @@ export default function History() {
|
|||||||
{/* END OF PURCHASE SECTION */}
|
{/* END OF PURCHASE SECTION */}
|
||||||
|
|
||||||
{/* RECENT ACTIVITY SECTION */}
|
{/* RECENT ACTIVITY SECTION */}
|
||||||
{tab == 'recent' &&
|
{selectedTab == 'recent activity' &&
|
||||||
<div className="wallet w-full border-t">
|
<div className="wallet w-full">
|
||||||
{/* <h1 className="p-2 text-xl font-bold text-dark-gray dark:text-white tracking-wide">Recent Activity</h1> */}
|
{/* <h1 className="p-2 text-xl font-bold text-dark-gray dark:text-white tracking-wide">Recent Activity</h1> */}
|
||||||
{/* <p className='text-base text-slate-500 dark:text-white'>Activity Report</p> */}
|
{/* <p className='text-base text-slate-500 dark:text-white'>Activity Report</p> */}
|
||||||
{paymentHistory.loading ?
|
{paymentHistory.loading ?
|
||||||
@@ -290,16 +305,16 @@ export default function History() {
|
|||||||
{/* END OF RECENT ACTIVITY SECTION */}
|
{/* END OF RECENT ACTIVITY SECTION */}
|
||||||
|
|
||||||
{/* REWARD SECTION */}
|
{/* REWARD SECTION */}
|
||||||
{tab == 'reward' &&
|
{selectedTab == 'rewards' &&
|
||||||
<div className="wallet w-full border-t">
|
<div className="wallet w-full">
|
||||||
<RewardsTable />
|
<RewardsTable />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{/* END OF REWARD SECTION */}
|
{/* END OF REWARD SECTION */}
|
||||||
|
|
||||||
{/* JOBS COMPLETED SECTION */}
|
{/* JOBS COMPLETED SECTION */}
|
||||||
{tab == 'jobs_completed' &&
|
{selectedTab == 'jobs completed' &&
|
||||||
<div className="wallet w-full border-t">
|
<div className="wallet w-full">
|
||||||
<JobsCompleted />
|
<JobsCompleted />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export default function Home(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<div className="home-page-wrapper">
|
<div className="w-full">
|
||||||
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
||||||
<FamilyDash
|
<FamilyDash
|
||||||
account={userDetails}
|
account={userDetails}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export default function AddGroup({ action, situation, setUpdateList }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalCom action={action} situation={situation}>
|
<ModalCom action={action} situation={situation}>
|
||||||
<div className="logout-modal-wrapper lg:w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
<div className="logout-modal-wrapper lg:w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
<div className="modal-header-con">
|
<div className="modal-header-con">
|
||||||
<h1 className="modal-title">
|
<h1 className="modal-title">
|
||||||
Add Group
|
Add Group
|
||||||
@@ -135,28 +135,6 @@ export default function AddGroup({ action, situation, setUpdateList }) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full flex justify-between items-center gap-4">
|
|
||||||
<button
|
|
||||||
onClick={action}
|
|
||||||
type="button"
|
|
||||||
className="w-[152px] h-[46px] flex justify-center items-center rounded-full text-base text-light-red tracking-wide border border-light-red"
|
|
||||||
>
|
|
||||||
<span className="">
|
|
||||||
Cancel
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
{requestStatus.loading ? (
|
|
||||||
<LoadingSpinner size="8" color="sky-blue" />
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
onClick={() => addGroup()}
|
|
||||||
type="button"
|
|
||||||
className="w-[152px] h-[46px] flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
|
||||||
>
|
|
||||||
Add Group
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||||
{requestStatus.message != "" &&
|
{requestStatus.message != "" &&
|
||||||
@@ -177,6 +155,29 @@ export default function AddGroup({ action, situation, setUpdateList }) {
|
|||||||
))}
|
))}
|
||||||
{/* End of error or success display */}
|
{/* End of error or success display */}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="modal-footer-wrapper">
|
||||||
|
<button
|
||||||
|
onClick={action}
|
||||||
|
type="button"
|
||||||
|
className="custom-btn text-light-red border border-light-red"
|
||||||
|
>
|
||||||
|
<span className="">
|
||||||
|
Cancel
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
{requestStatus.loading ? (
|
||||||
|
<LoadingSpinner size="8" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
onClick={() => addGroup()}
|
||||||
|
type="button"
|
||||||
|
className="custom-btn btn-gradient text-white"
|
||||||
|
>
|
||||||
|
Add Group
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ModalCom>
|
</ModalCom>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ export default function DeleteGroup({action, situation, details}) {
|
|||||||
action={action}
|
action={action}
|
||||||
situation={situation}
|
situation={situation}
|
||||||
>
|
>
|
||||||
<div className="logout-modal-wrapper lg:w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
<div className="logout-modal-wrapper lg:w-[500px] h-full lg:h-auto 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: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 Group
|
Delete Group
|
||||||
</h1>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#374557] dark:text-red-500"
|
className="modal-close-btn"
|
||||||
onClick={action}
|
onClick={action}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -76,26 +76,6 @@ export default function DeleteGroup({action, situation, details}) {
|
|||||||
Are you sure, you want to delete <br /> <span>'{details?.group_name}'</span> group?
|
Are you sure, you want to delete <br /> <span>'{details?.group_name}'</span> group?
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex space-x-2.5">
|
|
||||||
<button
|
|
||||||
onClick={action}
|
|
||||||
type="button"
|
|
||||||
className=" border-gradient text-18 tracking-wide px-4 py-3 rounded-full"
|
|
||||||
>
|
|
||||||
<span className="text-gradient">Cancel</span>
|
|
||||||
</button>
|
|
||||||
{requestStatus.laoding ? (
|
|
||||||
<LoadingSpinner size="8" color="sky-blue" />
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
onClick={() => deleteGroup()}
|
|
||||||
type="button"
|
|
||||||
className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full"
|
|
||||||
>
|
|
||||||
Confirm Delete
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||||
{requestStatus.message != "" &&
|
{requestStatus.message != "" &&
|
||||||
@@ -116,6 +96,26 @@ export default function DeleteGroup({action, situation, details}) {
|
|||||||
))}
|
))}
|
||||||
{/* End of error or success display */}
|
{/* End of error or success display */}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="modal-footer-wrapper">
|
||||||
|
<button
|
||||||
|
onClick={action}
|
||||||
|
type="button"
|
||||||
|
className="custom-btn border-gradient"
|
||||||
|
>
|
||||||
|
<span className="text-gradient">Cancel</span>
|
||||||
|
</button>
|
||||||
|
{requestStatus.laoding ? (
|
||||||
|
<LoadingSpinner size="8" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
onClick={() => deleteGroup()}
|
||||||
|
type="button"
|
||||||
|
className="custom-btn primary-gradient text-white"
|
||||||
|
>
|
||||||
|
Confirm Delete
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ModalCom>
|
</ModalCom>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default function DeleteMember({action, situation, details}) {
|
|||||||
action={action}
|
action={action}
|
||||||
situation={situation}
|
situation={situation}
|
||||||
>
|
>
|
||||||
<div className="logout-modal-wrapper lg:w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
<div className="logout-modal-wrapper lg:w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
<div className="modal-header-con">
|
<div className="modal-header-con">
|
||||||
<h1 className="modal-title">
|
<h1 className="modal-title">
|
||||||
Remove Member
|
Remove Member
|
||||||
@@ -76,26 +76,6 @@ export default function DeleteMember({action, situation, details}) {
|
|||||||
Are you sure, you want to remove <br /> <span>'{details?.firstname} {details.lastname}'</span>
|
Are you sure, you want to remove <br /> <span>'{details?.firstname} {details.lastname}'</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex space-x-2.5">
|
|
||||||
<button
|
|
||||||
onClick={action}
|
|
||||||
type="button"
|
|
||||||
className=" border-gradient text-18 tracking-wide px-4 py-3 rounded-full"
|
|
||||||
>
|
|
||||||
<span className="text-gradient">Cancel</span>
|
|
||||||
</button>
|
|
||||||
{requestStatus.laoding ? (
|
|
||||||
<LoadingSpinner size="8" color="sky-blue" />
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
onClick={() => deleteMember()}
|
|
||||||
type="button"
|
|
||||||
className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full"
|
|
||||||
>
|
|
||||||
Remove
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||||
{requestStatus.message != "" &&
|
{requestStatus.message != "" &&
|
||||||
@@ -116,6 +96,26 @@ export default function DeleteMember({action, situation, details}) {
|
|||||||
))}
|
))}
|
||||||
{/* End of error or success display */}
|
{/* End of error or success display */}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="modal-footer-wrapper">
|
||||||
|
<button
|
||||||
|
onClick={action}
|
||||||
|
type="button"
|
||||||
|
className="custom-btn border-gradient"
|
||||||
|
>
|
||||||
|
<span className="text-gradient">Cancel</span>
|
||||||
|
</button>
|
||||||
|
{requestStatus.laoding ? (
|
||||||
|
<LoadingSpinner size="8" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
onClick={() => deleteMember()}
|
||||||
|
type="button"
|
||||||
|
className="custom-btn primary-gradient text-white"
|
||||||
|
>
|
||||||
|
Remove
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ModalCom>
|
</ModalCom>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default function MainSection({
|
|||||||
);
|
);
|
||||||
const [tab, setTab] = useState(Object.keys(marketCategories)[0]);
|
const [tab, setTab] = useState(Object.keys(marketCategories)[0]);
|
||||||
|
|
||||||
let [contentDisplay, setContentDisplay] = useState("list"); // STATE TO HOLD LIST VIEW STYLE
|
let [contentDisplay, setContentDisplay] = useState("grid"); // STATE TO HOLD LIST VIEW STYLE
|
||||||
|
|
||||||
// Convert to array in order to map
|
// Convert to array in order to map
|
||||||
const mappedArray = Object.entries(marketCategories).map(([key, value]) => {
|
const mappedArray = Object.entries(marketCategories).map(([key, value]) => {
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md md:min-h-[420px] flex flex-col justify-between">
|
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md md:min-h-[420px] flex flex-col justify-between">
|
||||||
<div className="w-full flex flex-col justify-center pb-4 gap-2">
|
<div className="w-full flex flex-col justify-center pb-4 gap-2">
|
||||||
<p className="job-label w-full">
|
<p className="job-label w-full">
|
||||||
Interested in the task?
|
Interested?
|
||||||
</p>
|
</p>
|
||||||
<hr />
|
<hr />
|
||||||
<button
|
<button
|
||||||
@@ -262,9 +262,8 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
<div className="w-full flex flex-col justify-between gap-2">
|
<div className="w-full flex flex-col justify-between gap-2">
|
||||||
<span>Send</span>
|
<span>Notify</span>
|
||||||
<span>Interest</span>
|
<span>Owner</span>
|
||||||
<span>Request</span>
|
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default function ActiveJobMessage({ activeJobMesList }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col justify-between'>
|
<div className='flex flex-col justify-between'>
|
||||||
<div className="w-full h-full min-h-[400px] max-h-[400px] overflow-y-auto">
|
<div className="w-full h-full min-h-[250px] max-h-[300px] overflow-y-auto">
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className='border-b-2'>
|
<thead className='border-b-2'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600'>
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ import IndexJobActions from "./JobActions/IndexJobActions";
|
|||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
import { SocketValues } from "../Contexts/SocketIOContext";
|
import { SocketValues } from "../Contexts/SocketIOContext";
|
||||||
|
import TabButton from "../customTabs/TabButton";
|
||||||
|
import AttachFile from "../attachmentCom/AttachFile";
|
||||||
|
|
||||||
|
import JobDetailPopout from "./JobDetailPopout";
|
||||||
|
|
||||||
function ActiveJobs(props) {
|
function ActiveJobs(props) {
|
||||||
let {sendMessage, joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
let {sendMessage, joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
||||||
@@ -29,7 +33,9 @@ function ActiveJobs(props) {
|
|||||||
|
|
||||||
const [filesToSend, setFilesToSend] = useState([]); // State to hold the value of files to be sent
|
const [filesToSend, setFilesToSend] = useState([]); // State to hold the value of files to be sent
|
||||||
|
|
||||||
const [tab, setTab] = useState("message");
|
// const [tab, setTab] = useState("message");
|
||||||
|
const tabs = ["Send Message", "Send Files",] //STATE FOR SWITCHING BETWEEN TABS
|
||||||
|
const [selectedTab, setSelectedTab] = useState(tabs[0]);
|
||||||
|
|
||||||
const [requestStatus, setRequestStatus] = useState({
|
const [requestStatus, setRequestStatus] = useState({
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -39,6 +45,8 @@ function ActiveJobs(props) {
|
|||||||
|
|
||||||
let [popUp, setPopUp] = useState(false); // STATE FOR POPOUT MODAL
|
let [popUp, setPopUp] = useState(false); // STATE FOR POPOUT MODAL
|
||||||
|
|
||||||
|
let [jobDetailModal, setJobDetailModal] = useState(false); // STATE FOR JOB DELIVERY DETAIL POPOUT MODAL
|
||||||
|
|
||||||
const printRef = useRef();
|
const printRef = useRef();
|
||||||
// to handle printing
|
// to handle printing
|
||||||
const handlePrint = useReactToPrint({
|
const handlePrint = useReactToPrint({
|
||||||
@@ -50,6 +58,10 @@ function ActiveJobs(props) {
|
|||||||
setPopUp((prev) => !prev);
|
setPopUp((prev) => !prev);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const jobDetailModalHandler = () => { // FUNCTION TO CLOSE JOB DELIVERY DETAIL MODAL
|
||||||
|
setJobDetailModal((prev) => !prev);
|
||||||
|
};
|
||||||
|
|
||||||
// FUNCTION TO HANDLE MESSAGE CHANGE
|
// FUNCTION TO HANDLE MESSAGE CHANGE
|
||||||
const handleMessageChange = ({ target: { value } }) => {
|
const handleMessageChange = ({ target: { value } }) => {
|
||||||
setMessageToSend(value);
|
setMessageToSend(value);
|
||||||
@@ -63,7 +75,19 @@ function ActiveJobs(props) {
|
|||||||
// IF NO FILE SELECTED RETURN
|
// IF NO FILE SELECTED RETURN
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) {
|
let fileType = files[0].type.split('/')[0].toLowerCase()
|
||||||
|
if (fileType == 'video' && files[0].size > Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)) { // return if video file is more than 30mb
|
||||||
|
setRequestStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "File must be <= 30mb",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
|
}, 5000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
@@ -88,14 +112,15 @@ function ActiveJobs(props) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// INCLUDE FILE IF NO ERROR
|
// INCLUDE FILE IF NO ERROR
|
||||||
setFilesToSend((prev) => [...prev, files[0]]);
|
// setFilesToSend((prev) => [...prev, files[0]]); //for sending multiple file if need be
|
||||||
|
setFilesToSend([files[0]])
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
|
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
|
||||||
const handleClearAll = ({ target: { name } }) => {
|
const handleClearAll = ({ target: { name } }) => {
|
||||||
if (tab == "message") {
|
if (selectedTab == "Send Message") {
|
||||||
setMessageToSend("");
|
setMessageToSend("");
|
||||||
} else if (tab == "files") {
|
} else if (selectedTab == "Send Files") {
|
||||||
setFilesToSend([]);
|
setFilesToSend([]);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
@@ -177,61 +202,46 @@ function ActiveJobs(props) {
|
|||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
// const fileToBase64 = async () => {
|
||||||
|
// // Converts file data to base64 string
|
||||||
|
// try {
|
||||||
|
// const base64String = await convertFileToBase64(filesToSend[i]);
|
||||||
|
// return base64String;
|
||||||
|
// } catch (error) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
for (let i = 0; i <= filesToSend.length - 1; i++) {
|
let reqData = {
|
||||||
// Loops through files to send array and trigger upload API call
|
// file_name: filesToSend[i].name,
|
||||||
|
// file_size: filesToSend[i].size,
|
||||||
|
// file_type: "image/png",
|
||||||
|
// file_data: await fileToBase64(),
|
||||||
|
msg_type: "FILE",
|
||||||
|
contract: props.details.contract,
|
||||||
|
file: filesToSend[0],
|
||||||
|
};
|
||||||
|
|
||||||
const fileToBase64 = async () => {
|
ApiCall.sendFilesNew(reqData)
|
||||||
// Converts file data to base64 string
|
.then((res) => {
|
||||||
try {
|
if(res.status != 200 || res.data.internal_return < 0){
|
||||||
const base64String = await convertFileToBase64(filesToSend[i]);
|
setRequestStatus({loading: false, status: false, message: 'File could not be sent, try again later'})
|
||||||
return base64String;
|
return
|
||||||
} catch (error) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
};
|
setRequestStatus({loading: false, status: true, message: 'File Uploaded Successfully'})
|
||||||
|
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
||||||
// if(await !fileToBase64()){
|
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
||||||
// return
|
})
|
||||||
// }
|
.catch((error) => {
|
||||||
|
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
|
||||||
let reqData = {
|
})
|
||||||
file_name: filesToSend[i].name,
|
.finally(() => {
|
||||||
file_size: filesToSend[i].size,
|
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
||||||
file_type: "image/png",
|
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
||||||
file_data: await fileToBase64(),
|
setTimeout(() => {
|
||||||
msg_type: "FILE",
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
contract: props.details.contract,
|
}, 5000);
|
||||||
};
|
});
|
||||||
|
|
||||||
ApiCall.sendFiles(reqData)
|
|
||||||
.then((res) => {
|
|
||||||
// if(res.status != 200 || res.data.internal_return < 0){
|
|
||||||
// setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
|
|
||||||
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
|
||||||
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
// setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
if (i == filesToSend.length - 1) {
|
|
||||||
setRequestStatus({
|
|
||||||
loading: false,
|
|
||||||
status: true,
|
|
||||||
message: "File(s) Uploaded Successfully",
|
|
||||||
});
|
|
||||||
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
|
||||||
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
|
||||||
setTimeout(() => {
|
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
|
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
|
||||||
@@ -269,10 +279,10 @@ function ActiveJobs(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<div className="py-[20px] bg-white dark:bg-black dark:text-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-16">
|
<div className="py-[20px] bg-white dark:bg-black dark:text-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-8">
|
||||||
{/* job title */}
|
{/* job title */}
|
||||||
<div className="w-full md:w-8/12">
|
<div className="w-full">
|
||||||
<div className="w-full flex justify-start space-x-3 items-start">
|
<div className="w-full flex justify-start space-x-3 items-center">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
|
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
|
||||||
@@ -320,8 +330,8 @@ function ActiveJobs(props) {
|
|||||||
{/* end of job title */}
|
{/* end of job title */}
|
||||||
|
|
||||||
{/* job details */}
|
{/* job details */}
|
||||||
<div className="w-full md:w-4/12">
|
<div className="min-w-[150px]">
|
||||||
<p className="text-base text-sky-blue">Delivery Detail</p>
|
<button className="text-base text-sky-blue" onClick={jobDetailModalHandler}>Delivery Detail</button>
|
||||||
{passDue ? (
|
{passDue ? (
|
||||||
<div className="my-1">
|
<div className="my-1">
|
||||||
<p className="text-base text-slate-700">
|
<p className="text-base text-slate-700">
|
||||||
@@ -394,78 +404,119 @@ function ActiveJobs(props) {
|
|||||||
|
|
||||||
{/* TEXTAREA SECTION */}
|
{/* TEXTAREA SECTION */}
|
||||||
<div className="mt-5">
|
<div className="mt-5">
|
||||||
<div className="">
|
<div className="w-full">
|
||||||
<div
|
{/* switch button */}
|
||||||
className="pl-7 my-2 flex items-center border-b border-slate-300 gap-3"
|
<div className="grid grid-cols-2">
|
||||||
// className='ml-7 flex justify-start items-center gap-3'
|
{tabs.map((item) => (
|
||||||
>
|
<TabButton
|
||||||
<button
|
key={item}
|
||||||
name="message"
|
item={item}
|
||||||
onClick={(e) => setTab(e.target.name)}
|
selectedTab={selectedTab}
|
||||||
className={`px-4 py-1 rounded-t-2xl ${
|
setSelectedTab={setSelectedTab}
|
||||||
tab == "message"
|
|
||||||
? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white"
|
|
||||||
: "bg-white text-[#000] border-t-[2px]"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
Send Message
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
name="files"
|
|
||||||
onClick={(e) => setTab(e.target.name)}
|
|
||||||
className={`px-4 py-1 rounded-t-2xl ${
|
|
||||||
tab == "files"
|
|
||||||
? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white"
|
|
||||||
: "bg-white text-[#000] border-t-[2px]"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
Send Files
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{tab == "message" ? (
|
|
||||||
<textarea
|
|
||||||
className="p-4 w-full h-[200px] text-base text-slate-600 dark:text-white bg-white dark:bg-black border border-slate-300 outline-none"
|
|
||||||
// rows="10"
|
|
||||||
style={{ resize: "none" }}
|
|
||||||
name="message"
|
|
||||||
onChange={handleMessageChange}
|
|
||||||
value={messageToSend}
|
|
||||||
autoFocus
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<div className="p-4 w-full h-[200px] text-base text-slate-600 border border-slate-300">
|
|
||||||
<div className="files">
|
|
||||||
<label
|
|
||||||
htmlFor="file"
|
|
||||||
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
|
||||||
>
|
|
||||||
Select Files to Upload
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
type="file"
|
|
||||||
id="file"
|
|
||||||
accept="image/*"
|
|
||||||
style={{ display: "none" }}
|
|
||||||
onChange={handleFileChange}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
))}
|
||||||
<div className="selected_file my-2">
|
</div>
|
||||||
{filesToSend.length > 0 &&
|
{/* switch button */}
|
||||||
filesToSend.map((item, index) => (
|
<div className="w-full bg-red-50 overflow-x-auto">
|
||||||
<p key={index} className="flex items-center space-x-2">
|
{selectedTab == "Send Message" ? (
|
||||||
<span>{item.name}</span>
|
<div className="p-2 w-full">
|
||||||
<button
|
<textarea
|
||||||
name="remove"
|
className="p-4 w-full h-[150px] text-base text-slate-600 dark:text-white bg-white dark:bg-black outline-none"
|
||||||
onClick={() => handleRemoveImage(item)}
|
// rows="10"
|
||||||
className="px-2 flex justify-center items-center rounded-full border border-red-500 text-red-500"
|
style={{ resize: "none" }}
|
||||||
>
|
name="message"
|
||||||
x
|
onChange={handleMessageChange}
|
||||||
</button>
|
value={messageToSend}
|
||||||
</p>
|
autoFocus
|
||||||
))}
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="p-2 w-full">
|
||||||
|
<div className="p-4 mb-2 h-[150px] text-base text-slate-600">
|
||||||
|
<div className="files flex">
|
||||||
|
<label
|
||||||
|
htmlFor="file"
|
||||||
|
className="custom-btn btn-gradient text-base text-white"
|
||||||
|
>
|
||||||
|
Select Files to Upload
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
id="file"
|
||||||
|
accept="image/*,video/*"
|
||||||
|
style={{ display: "none" }}
|
||||||
|
onChange={handleFileChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="selected_file my-2 overflow-y-auto">
|
||||||
|
{filesToSend.length > 0 &&
|
||||||
|
filesToSend.map((item, index) => (
|
||||||
|
<p key={index} className="flex items-center space-x-2">
|
||||||
|
<span>{item.name}</span>
|
||||||
|
<button
|
||||||
|
name="remove"
|
||||||
|
onClick={() => handleRemoveImage(item)}
|
||||||
|
className="px-2 flex justify-center items-center rounded-full border border-red-500 text-red-500"
|
||||||
|
>
|
||||||
|
x
|
||||||
|
</button>
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* Buttons Sections */}
|
||||||
|
<div className="p-2 grid grid-cols-1 xxs:grid-cols-3">
|
||||||
|
<div className="w-full col-span-3 col-start-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center gap-4">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={handleClearAll}
|
||||||
|
className="custom-btn border-gradient"
|
||||||
|
>
|
||||||
|
<span className="text-gradient">Clear</span>
|
||||||
|
</button>
|
||||||
|
{selectedTab == "Send Files" ? (
|
||||||
|
<button
|
||||||
|
onClick={sendFile}
|
||||||
|
type="button"
|
||||||
|
className="custom-btn btn-gradient text-white"
|
||||||
|
>
|
||||||
|
{requestStatus.loading ? (
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width="20"
|
||||||
|
height="20"
|
||||||
|
fill="white"
|
||||||
|
>
|
||||||
|
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<span className="text-white">Upload Files</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
onClick={sendTaskMessage}
|
||||||
|
type="button"
|
||||||
|
className="custom-btn btn-gradient text-white"
|
||||||
|
>
|
||||||
|
{requestStatus.loading ? (
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<span className="text-white">Send</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* end of Buttons Sections */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||||
@@ -489,63 +540,19 @@ function ActiveJobs(props) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
{/* End of error or success display */}
|
{/* End of error or success display */}
|
||||||
|
|
||||||
{/* Buttons Sections */}
|
|
||||||
<div className="py-2 sm:flex sm:justify-end sm:items-center">
|
|
||||||
<div className="w-full sm:w-3/4 flex justify-between items-center space-x-2">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={handleClearAll}
|
|
||||||
className="border-gradient text-base tracking-wide px-4 py-2 rounded-full"
|
|
||||||
>
|
|
||||||
<span className="text-gradient">Clear</span>
|
|
||||||
</button>
|
|
||||||
{tab == "files" ? (
|
|
||||||
<button
|
|
||||||
onClick={sendFile}
|
|
||||||
type="button"
|
|
||||||
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer flex justify-center items-center"
|
|
||||||
>
|
|
||||||
{requestStatus.loading ? (
|
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
fill="white"
|
|
||||||
>
|
|
||||||
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z" />
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<span className="text-white">Upload Files</span>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
onClick={sendTaskMessage}
|
|
||||||
type="button"
|
|
||||||
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
|
||||||
>
|
|
||||||
{requestStatus.loading ? (
|
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
|
||||||
) : (
|
|
||||||
<span className="text-white">Send</span>
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/* end of Buttons Sections */}
|
|
||||||
</div>
|
</div>
|
||||||
{/* END OF TEXTAREA */}
|
{/* END OF TEXTAREA */}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* MESSAGE SECTION */}
|
{/* MESSAGE SECTION */}
|
||||||
<div className="w-full lg:w-1/2">
|
<div className="w-full lg:w-1/2">
|
||||||
|
<div className="mb-4">
|
||||||
|
<AttachFile
|
||||||
|
data={props.details}
|
||||||
|
showOnData={true}
|
||||||
|
fontSize={'text-lg'}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div className="flex justify-between items-center gap-5">
|
<div className="flex justify-between items-center gap-5">
|
||||||
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2 justify-between">
|
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2 justify-between">
|
||||||
<span>Message</span>
|
<span>Message</span>
|
||||||
@@ -586,6 +593,16 @@ function ActiveJobs(props) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{/* END OF POPOUT SECTION */}
|
{/* END OF POPOUT SECTION */}
|
||||||
|
|
||||||
|
{/* Delivery Details Popout */}
|
||||||
|
{jobDetailModal &&
|
||||||
|
<JobDetailPopout
|
||||||
|
action={jobDetailModalHandler}
|
||||||
|
situation={jobDetailModal}
|
||||||
|
jobDetail={props?.details?.job_description}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
{/* END Delivery Details Popout */}
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const VideoElement = lazy(() => import("../VideoCom/VideoElement"));
|
|||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
import { SocketValues } from "../Contexts/SocketIOContext";
|
import { SocketValues } from "../Contexts/SocketIOContext";
|
||||||
|
import TabButton from "../customTabs/TabButton";
|
||||||
|
|
||||||
function ActiveJobsMedia(props) {
|
function ActiveJobsMedia(props) {
|
||||||
let {sendMessage, joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
let {sendMessage, joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
||||||
@@ -32,7 +33,9 @@ function ActiveJobsMedia(props) {
|
|||||||
|
|
||||||
const [filesToSend, setFilesToSend] = useState([]); // State to hold the value of files to be sent
|
const [filesToSend, setFilesToSend] = useState([]); // State to hold the value of files to be sent
|
||||||
|
|
||||||
const [tab, setTab] = useState("message");
|
// const [tab, setTab] = useState("message");
|
||||||
|
const tabs = ["Send Message", "Send Files",] //STATE FOR SWITCHING BETWEEN TABS
|
||||||
|
const [selectedTab, setSelectedTab] = useState(tabs[0]);
|
||||||
|
|
||||||
const [requestStatus, setRequestStatus] = useState({
|
const [requestStatus, setRequestStatus] = useState({
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -66,7 +69,19 @@ function ActiveJobsMedia(props) {
|
|||||||
// IF NO FILE SELECTED RETURN
|
// IF NO FILE SELECTED RETURN
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) {
|
let fileType = files[0].type.split('/')[0].toLowerCase()
|
||||||
|
if (fileType == 'video' && files[0].size > Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)) { // return if video file is more than 30mb
|
||||||
|
setRequestStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "File must be <= 30mb",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
|
}, 5000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
@@ -91,14 +106,15 @@ function ActiveJobsMedia(props) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// INCLUDE FILE IF NO ERROR
|
// INCLUDE FILE IF NO ERROR
|
||||||
setFilesToSend((prev) => [...prev, files[0]]);
|
// setFilesToSend((prev) => [...prev, files[0]]); //for sending multiple file if need be
|
||||||
|
setFilesToSend([files[0]])
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
|
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
|
||||||
const handleClearAll = ({ target: { name } }) => {
|
const handleClearAll = ({ target: { name } }) => {
|
||||||
if (tab == "message") {
|
if (selectedTab == "Send Message") {
|
||||||
setMessageToSend("");
|
setMessageToSend("");
|
||||||
} else if (tab == "files") {
|
} else if (selectedTab == "Send Files") {
|
||||||
setFilesToSend([]);
|
setFilesToSend([]);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
@@ -181,60 +197,42 @@ function ActiveJobsMedia(props) {
|
|||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i <= filesToSend.length - 1; i++) {
|
// const fileToBase64 = async () => {
|
||||||
// Loops through files to send array and trigger upload API call
|
// // Converts file data to base64 string
|
||||||
|
// try {
|
||||||
|
// const base64String = await convertFileToBase64(filesToSend[i]);
|
||||||
|
// return base64String;
|
||||||
|
// } catch (error) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
const fileToBase64 = async () => {
|
let reqData = {
|
||||||
// Converts file data to base64 string
|
msg_type: "FILE",
|
||||||
try {
|
contract: props.details.contract,
|
||||||
const base64String = await convertFileToBase64(filesToSend[i]);
|
file: filesToSend[0],
|
||||||
return base64String;
|
};
|
||||||
} catch (error) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// if(await !fileToBase64()){
|
ApiCall.sendFilesNew(reqData)
|
||||||
// return
|
.then((res) => {
|
||||||
// }
|
if(res.status != 200 || res.data.internal_return < 0){
|
||||||
|
setRequestStatus({loading: false, status: false, message: 'File could not be sent, try again later'})
|
||||||
let reqData = {
|
return
|
||||||
file_name: filesToSend[i].name,
|
}
|
||||||
file_size: filesToSend[i].size,
|
setRequestStatus({loading: false, status: true, message: 'File Uploaded Successfully'})
|
||||||
file_type: "image/png",
|
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
||||||
file_data: await fileToBase64(),
|
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
||||||
msg_type: "FILE",
|
})
|
||||||
contract: props.details.contract,
|
.catch((error) => {
|
||||||
};
|
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
|
||||||
|
})
|
||||||
ApiCall.sendFiles(reqData)
|
.finally(() => {
|
||||||
.then((res) => {
|
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
||||||
// if(res.status != 200 || res.data.internal_return < 0){
|
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
||||||
// setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
|
setTimeout(() => {
|
||||||
// return
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
// }
|
}, 5000);
|
||||||
// setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
|
});
|
||||||
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
|
||||||
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
// setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
if (i == filesToSend.length - 1) {
|
|
||||||
setRequestStatus({
|
|
||||||
loading: false,
|
|
||||||
status: true,
|
|
||||||
message: "File(s) Uploaded Successfully",
|
|
||||||
});
|
|
||||||
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
|
||||||
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
|
||||||
setTimeout(() => {
|
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
|
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
|
||||||
@@ -275,314 +273,288 @@ function ActiveJobsMedia(props) {
|
|||||||
backpath={props.details.pathname}
|
backpath={props.details.pathname}
|
||||||
title={props.details?.title ? props.details.title : ''}
|
title={props.details?.title ? props.details.title : ''}
|
||||||
>
|
>
|
||||||
{/* job title */}
|
<div className="my-4 lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
|
||||||
{/* <div className="py-[20px] bg-white dark:bg-black dark:text-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-16">
|
<div className="w-full mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
|
||||||
<div className="w-full">
|
|
||||||
<div className="w-full flex justify-start space-x-3 items-start">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
|
|
||||||
onClick={() => {
|
|
||||||
if (props.details.pathname == "/manage-family") {
|
|
||||||
navigate(
|
|
||||||
props.details.pathname,
|
|
||||||
{ state: { ...props.details.accountDetails } },
|
|
||||||
{ replace: true }
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
navigate(props.details.pathname, { replace: true });
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="35"
|
|
||||||
height="35"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="skyblue"
|
|
||||||
>
|
|
||||||
<path d="M19 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H19v-2z" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
<h1 className="text-base md:text-[20px] font-bold text-dark-gray dark:text-white tracking-wide">
|
|
||||||
{props.details?.title && props.details.title}
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
{/* end of job title */}
|
|
||||||
|
|
||||||
<div className="my-4 lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
|
|
||||||
<div className="w-full mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
|
|
||||||
|
|
||||||
<div className="mb-4 w-full h-auto">
|
<div className="mb-4 w-full h-auto">
|
||||||
<VideoElement videoId={props?.details?.media_uid} />
|
<VideoElement videoId={props?.details?.media_uid} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full p-4 bg-white dark:bg-black rounded-2xl shadow-md md:flex md:justify-between gap-8">
|
<div className="w-full p-4 bg-white dark:bg-black rounded-2xl shadow-md xl:flex xl:justify-between gap-4">
|
||||||
<div className="w-full flex flex-col justify-between">
|
<div className="w-full flex flex-col justify-between">
|
||||||
<div className="w-full">
|
{/* <p className="w-full text-base text-right text-sky-blue">
|
||||||
<p className="w-full text-base text-right text-sky-blue">
|
{props?.details && props.details.job_to}
|
||||||
{props?.details && props.details.job_to}
|
</p> */}
|
||||||
</p>
|
<div className="text-base tracking-wide">
|
||||||
<div className="text-base tracking-wide">
|
<p className="font-semibold text-black dark:text-white tracking-wider">
|
||||||
<p className="font-semibold text-black dark:text-white tracking-wider">
|
Description:{" "}
|
||||||
Description:{" "}
|
</p>
|
||||||
</p>
|
<p className="p-2 ml-8 border-b border-sky-blue">
|
||||||
<p className="p-2 ml-8 border-b border-sky-blue">
|
{props?.details && props.details.description}
|
||||||
{props?.details && props.details.description}
|
</p>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
<div className="mt-6 w-full">
|
||||||
<div className="mt-6 w-full lg:flex gap-8">
|
<div className="w-full text-base tracking-wide">
|
||||||
<div className="w-full text-base tracking-wide">
|
<p className="font-semibold text-black dark:text-white tracking-wider">
|
||||||
<p className="font-semibold text-black dark:text-white tracking-wider">
|
Delivery Detail:{" "}
|
||||||
Delivery Detail:{" "}
|
</p>
|
||||||
</p>
|
<p className="p-2 ml-8">
|
||||||
<p className="p-2 ml-8">
|
{props?.details && props.details.job_description}
|
||||||
{props?.details && props.details.job_description}
|
</p>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
{/* <div className="my-2 xl:my-0">
|
||||||
<div className="my-2 lg:my-0">
|
<IndexJobActions details={props.details} />
|
||||||
<IndexJobActions details={props.details} />
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* job details */}
|
<div className="flex justify-between items-center gap-1 xl:min-w-[350px]">
|
||||||
<div className="w-full md:w-[200px] flex flex-col justify-center gap-4">
|
<div className="h-[150px] xl:h-full w-[150px] xl:min-w-[150px]">
|
||||||
{/* <p className="text-base text-sky-blue">Delivery Detail</p> */}
|
<IndexJobActions details={props.details} />
|
||||||
{passDue ? (
|
</div>
|
||||||
<div className="my-1">
|
{/* job details */}
|
||||||
<p className="text-base text-slate-700">
|
<div className="min-w-[170px] flex flex-col justify-center gap-2">
|
||||||
<span className="font-semibold">Due: </span>
|
{/* <p className="text-base text-sky-blue">Delivery Detail</p> */}
|
||||||
{props?.details && props.details.delivery_date.split(" ")[0]}
|
{passDue ? (
|
||||||
</p>
|
<div className="my-1">
|
||||||
{props?.delivery_date && (
|
<p className="text-base text-slate-700">
|
||||||
<p className="py-2 text-base text-slate-700">
|
<span className="font-semibold">Due: </span>
|
||||||
{props.details.delivery_date.split(" ")[1]}
|
{props?.details && props.details.delivery_date.split(" ")[0]}
|
||||||
</p>
|
</p>
|
||||||
)}
|
{props?.delivery_date && (
|
||||||
</div>
|
<p className="py-2 text-base text-slate-700">
|
||||||
) : (
|
{props.details.delivery_date.split(" ")[1]}
|
||||||
<div className="my-1 flex items-start gap-3">
|
</p>
|
||||||
<p className="font-semibold">Due: </p>
|
)}
|
||||||
<div className="flex flex-col justify-between">
|
</div>
|
||||||
<p className="text-base text-slate-700 tracking-wide">
|
) : (
|
||||||
<CountDown
|
<div className="my-1 flex items-start gap-3">
|
||||||
lastDate={props?.details && props.details.delivery_date}
|
<p className="font-semibold">Due: </p>
|
||||||
/>
|
<div className="flex flex-col justify-between">
|
||||||
</p>
|
<p className="text-base text-slate-700 tracking-wide">
|
||||||
<div className="text-base text-slate-700 tracking-wide flex gap-[5px]">
|
<CountDown
|
||||||
<span>Hrs</span>
|
lastDate={props?.details && props.details.delivery_date}
|
||||||
<span>Min</span>
|
/>
|
||||||
<span>Sec</span>
|
</p>
|
||||||
</div>
|
<div className="text-base text-slate-700 tracking-wide flex gap-[5px]">
|
||||||
</div>
|
<span>Hrs</span>
|
||||||
</div>
|
<span>Min</span>
|
||||||
)}
|
<span>Sec</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
|
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
|
||||||
<span className="font-semibold text-black dark:text-white">
|
<span className="font-semibold text-black dark:text-white">
|
||||||
Reward:{" "}
|
Reward:{" "}
|
||||||
</span>
|
</span>
|
||||||
<span className="">{thePrice}</span>
|
<span className="">{thePrice}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
|
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
|
||||||
<span className="font-semibold text-black dark:text-white">
|
<span className="font-semibold text-black dark:text-white">
|
||||||
Duration:{" "}
|
Duration:{" "}
|
||||||
</span>
|
</span>
|
||||||
<span className="">
|
<span className="">
|
||||||
{props.details?.timeline_days && props.details.timeline_days}{" "}
|
{props.details?.timeline_days && props.details.timeline_days}{" "}
|
||||||
day(s)
|
day(s)
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
|
</div>
|
||||||
<span className="font-semibold text-black dark:text-white">
|
{/* end of job details */}
|
||||||
No:{" "}
|
|
||||||
</span>
|
|
||||||
<span className="">
|
|
||||||
{props.details?.contract && props.details.contract}
|
|
||||||
</span>
|
|
||||||
</div> */}
|
|
||||||
</div>
|
</div>
|
||||||
{/* end of job details */}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="w-full lg:w-2/5 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-1 gap-4">
|
<div className="w-full lg:w-2/5 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-1 gap-4">
|
||||||
{/* TEXTAREA SECTION */}
|
{/* TEXTAREA SECTION */}
|
||||||
<div className="w-full mb-3">
|
<div className="w-full mb-3">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="pl-7 flex items-center gap-3">
|
{/* <div className="pl-7 flex items-center gap-3">
|
||||||
<button
|
<button
|
||||||
|
name="message"
|
||||||
|
onClick={(e) => setTab(e.target.name)}
|
||||||
|
className={`px-4 xl:px-1 xxl:px-4 text-sm py-1 rounded-t-2xl ${
|
||||||
|
tab == "message"
|
||||||
|
? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white"
|
||||||
|
: "bg-white text-[#000] border-t-[2px]"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
Send Message
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
name="files"
|
||||||
|
onClick={(e) => setTab(e.target.name)}
|
||||||
|
className={`px-4 xl:px-1 xxl:px-4 text-sm py-1 rounded-t-2xl ${
|
||||||
|
tab == "files"
|
||||||
|
? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white"
|
||||||
|
: "bg-white text-[#000] border-t-[2px]"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
Send Files
|
||||||
|
</button>
|
||||||
|
</div> */}
|
||||||
|
{/* switch button */}
|
||||||
|
<div className="grid grid-cols-2">
|
||||||
|
{tabs.map((item) => (
|
||||||
|
<TabButton
|
||||||
|
key={item}
|
||||||
|
item={item}
|
||||||
|
selectedTab={selectedTab}
|
||||||
|
setSelectedTab={setSelectedTab}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
{/* switch button */}
|
||||||
|
<div className="w-full bg-red-50 overflow-x-auto">
|
||||||
|
{selectedTab == "Send Message" ? (
|
||||||
|
<div className="p-2 w-full">
|
||||||
|
<textarea
|
||||||
|
className="p-4 w-full h-[150px] text-base text-slate-600 dark:text-white bg-white dark:bg-black outline-none"
|
||||||
|
// rows="10"
|
||||||
|
style={{ resize: "none" }}
|
||||||
name="message"
|
name="message"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onChange={handleMessageChange}
|
||||||
className={`px-4 xl:px-1 xxl:px-4 text-sm py-1 rounded-t-2xl ${
|
value={messageToSend}
|
||||||
tab == "message"
|
autoFocus
|
||||||
? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white"
|
|
||||||
: "bg-white text-[#000] border-t-[2px]"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
Send Message
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
name="files"
|
|
||||||
onClick={(e) => setTab(e.target.name)}
|
|
||||||
className={`px-4 xl:px-1 xxl:px-4 text-sm py-1 rounded-t-2xl ${
|
|
||||||
tab == "files"
|
|
||||||
? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white"
|
|
||||||
: "bg-white text-[#000] border-t-[2px]"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
Send Files
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{tab == "message" ? (
|
|
||||||
<textarea
|
|
||||||
className="p-4 w-full h-[150px] text-base text-slate-600 dark:text-white bg-white dark:bg-black border-4 border-[#4687ba] outline-none"
|
|
||||||
// rows="10"
|
|
||||||
style={{ resize: "none" }}
|
|
||||||
name="message"
|
|
||||||
onChange={handleMessageChange}
|
|
||||||
value={messageToSend}
|
|
||||||
autoFocus
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<div className="p-4 mb-2 h-[150px] text-base text-slate-600 border-4 border-[#4687ba]">
|
|
||||||
<div className="files flex">
|
|
||||||
<label
|
|
||||||
htmlFor="file"
|
|
||||||
className="custom-btn btn-gradient text-base text-white"
|
|
||||||
>
|
|
||||||
Select Files to Upload
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
type="file"
|
|
||||||
id="file"
|
|
||||||
accept="image/*"
|
|
||||||
style={{ display: "none" }}
|
|
||||||
onChange={handleFileChange}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="selected_file my-2 overflow-y-auto">
|
) : (
|
||||||
{filesToSend.length > 0 &&
|
<div className="p-2 w-full">
|
||||||
filesToSend.map((item, index) => (
|
<div className="p-4 mb-2 h-[150px] text-base text-slate-600">
|
||||||
<p key={index} className="flex items-center space-x-2">
|
<div className="files flex">
|
||||||
<span>{item.name}</span>
|
<label
|
||||||
<button
|
htmlFor="file"
|
||||||
name="remove"
|
className="custom-btn btn-gradient text-base text-white"
|
||||||
onClick={() => handleRemoveImage(item)}
|
>
|
||||||
className="px-2 flex justify-center items-center rounded-full border border-red-500 text-red-500"
|
Select Files to Upload
|
||||||
>
|
</label>
|
||||||
x
|
<input
|
||||||
</button>
|
type="file"
|
||||||
</p>
|
id="file"
|
||||||
))}
|
accept="image/*,video/*"
|
||||||
</div>
|
style={{ display: "none" }}
|
||||||
|
onChange={handleFileChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="selected_file my-2 overflow-y-auto">
|
||||||
|
{filesToSend.length > 0 &&
|
||||||
|
filesToSend.map((item, index) => (
|
||||||
|
<p key={index} className="flex items-center space-x-2">
|
||||||
|
<span>{item.name}</span>
|
||||||
|
<button
|
||||||
|
name="remove"
|
||||||
|
onClick={() => handleRemoveImage(item)}
|
||||||
|
className="px-2 flex justify-center items-center rounded-full border border-red-500 text-red-500"
|
||||||
|
>
|
||||||
|
x
|
||||||
|
</button>
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
{/* Buttons Sections */}
|
||||||
|
<div className="p-2 grid grid-cols-1 xxs:grid-cols-3">
|
||||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
<div className="w-full col-span-3 col-start-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center gap-4">
|
||||||
<div className="w-full">
|
|
||||||
{/* error or success display */}
|
|
||||||
{requestStatus.message != "" &&
|
|
||||||
(!requestStatus.status ? (
|
|
||||||
<div
|
|
||||||
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
|
||||||
>
|
|
||||||
{requestStatus.message}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
requestStatus.status && (
|
|
||||||
<div
|
|
||||||
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
|
||||||
>
|
|
||||||
{requestStatus.message}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
{/* End of error or success display */}
|
|
||||||
|
|
||||||
{/* Buttons Sections */}
|
|
||||||
<div className="py-1 grid grid-cols-1 xxs:grid-cols-3">
|
|
||||||
<div className="w-full col-span-3 col-start-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center gap-4">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={handleClearAll}
|
|
||||||
className="custom-btn border-gradient"
|
|
||||||
>
|
|
||||||
<span className="text-gradient">Clear</span>
|
|
||||||
</button>
|
|
||||||
{tab == "files" ? (
|
|
||||||
<button
|
<button
|
||||||
onClick={sendFile}
|
type="button"
|
||||||
type="button"
|
onClick={handleClearAll}
|
||||||
className="custom-btn btn-gradient text-white"
|
className="custom-btn border-gradient"
|
||||||
>
|
>
|
||||||
{requestStatus.loading ? (
|
<span className="text-gradient">Clear</span>
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
</button>
|
||||||
) : (
|
{selectedTab == "Send Files" ? (
|
||||||
<>
|
<button
|
||||||
<svg
|
onClick={sendFile}
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
type="button"
|
||||||
viewBox="0 0 24 24"
|
className="custom-btn btn-gradient text-white"
|
||||||
width="20"
|
|
||||||
height="20"
|
|
||||||
fill="white"
|
|
||||||
>
|
>
|
||||||
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z" />
|
{requestStatus.loading ? (
|
||||||
</svg>
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width="20"
|
||||||
|
height="20"
|
||||||
|
fill="white"
|
||||||
|
>
|
||||||
|
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
<span className="text-white">Upload Files</span>
|
<span className="text-white">Upload Files</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
onClick={sendTaskMessage}
|
|
||||||
type="button"
|
|
||||||
className="custom-btn btn-gradient text-white"
|
|
||||||
>
|
|
||||||
{requestStatus.loading ? (
|
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
|
||||||
) : (
|
) : (
|
||||||
<span className="text-white">Send</span>
|
<button
|
||||||
|
onClick={sendTaskMessage}
|
||||||
|
type="button"
|
||||||
|
className="custom-btn btn-gradient text-white"
|
||||||
|
>
|
||||||
|
{requestStatus.loading ? (
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<span className="text-white">Send</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
)}
|
)}
|
||||||
</button>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/* end of Buttons Sections */}
|
||||||
{/* end of Buttons Sections */}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* END OF TEXTAREA */}
|
|
||||||
|
|
||||||
{/* MESSAGE SECTION */}
|
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||||
<div className="w-full p-4 bg-white dark:bg-black rounded-2xl shadow-md">
|
<div className="w-full">
|
||||||
<div className="flex justify-between items-center gap-5">
|
{/* error or success display */}
|
||||||
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2 justify-between">
|
{requestStatus.message != "" &&
|
||||||
<span>Message</span>
|
(!requestStatus.status ? (
|
||||||
<button
|
<div
|
||||||
type="button"
|
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
onClick={popUpHandler}
|
>
|
||||||
className="text-[12px] tracking-wider text-gray-400 dark:text-slate-400"
|
{requestStatus.message}
|
||||||
>
|
</div>
|
||||||
View all
|
) : (
|
||||||
</button>
|
requestStatus.status && (
|
||||||
</p>
|
<div
|
||||||
</div>
|
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
{props.activeJobMesList.loading ? (
|
>
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
{requestStatus.message}
|
||||||
) : (
|
</div>
|
||||||
<ActiveJobMessageMedia activeJobMesList={props.activeJobMesList} />
|
)
|
||||||
)}
|
))}
|
||||||
</div>
|
</div>
|
||||||
{/* END OF MESSAGE */}
|
{/* End of error or success display */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/* END OF TEXTAREA */}
|
||||||
|
|
||||||
|
{/* MESSAGE SECTION */}
|
||||||
|
<div className="w-full p-4 bg-white dark:bg-black rounded-2xl shadow-md">
|
||||||
|
<div className="flex justify-between items-center gap-5">
|
||||||
|
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2 justify-between">
|
||||||
|
<span>Message</span>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={popUpHandler}
|
||||||
|
className="text-[12px] tracking-wider text-gray-400 dark:text-slate-400"
|
||||||
|
>
|
||||||
|
View all
|
||||||
|
</button>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{props.activeJobMesList.loading ? (
|
||||||
|
<LoadingSpinner size="16" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<ActiveJobMessageMedia activeJobMesList={props.activeJobMesList} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{/* END OF MESSAGE */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* POPOUT SECTION */}
|
{/* POPOUT SECTION */}
|
||||||
{popUp && (
|
{popUp && (
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='dark:bg-black'>
|
<div className='h-full dark:bg-black'>
|
||||||
|
|
||||||
<div className="w-full text-sm text-left text-gray-500">
|
<div className="h-full w-full text-sm text-left text-gray-500">
|
||||||
{jobDetails.job_type == 'MEDIA' ?
|
{jobDetails.job_type == 'MEDIA' ?
|
||||||
<div className="flex justify-center items-center">
|
<div className="h-full flex justify-center items-center">
|
||||||
<button onClick={popUpHandler} type="button" className="btn-gradient text-white p-1 lg:p-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl">
|
<button onClick={popUpHandler} type="button" className="btn-gradient h-full text-white p-1 lg:p-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl">
|
||||||
I have completed this task
|
I have completed this task
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import ModalCom from '../Helpers/ModalCom'
|
||||||
|
|
||||||
|
export default function JobDetailPopout({action, situation, jobDetail}) {
|
||||||
|
return (
|
||||||
|
<ModalCom action={action} situation={situation}>
|
||||||
|
<div className="modal-container">
|
||||||
|
<div className="modal-header-con">
|
||||||
|
<h1 className="modal-title">
|
||||||
|
Delivery Detail
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="modal-close-btn"
|
||||||
|
onClick={action}
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
width="36"
|
||||||
|
height="36"
|
||||||
|
viewBox="0 0 36 36"
|
||||||
|
fill="none"
|
||||||
|
className="fill-current"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
||||||
|
fill=""
|
||||||
|
fillOpacity="0.6"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
||||||
|
fill="#"
|
||||||
|
fillOpacity="0.6"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="modal-body-wrapper">
|
||||||
|
<p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p>
|
||||||
|
</div>
|
||||||
|
<div className="modal-footer-wrapper justify-end">
|
||||||
|
<button
|
||||||
|
onClick={action}
|
||||||
|
className="custom-btn border-gradient"
|
||||||
|
>
|
||||||
|
<span className="text-gradient">Close</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ModalCom>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -7,13 +7,14 @@ import { handlePagingFunc } from "../Pagination/HandlePagination";
|
|||||||
import PaginatedList from "../Pagination/PaginatedList";
|
import PaginatedList from "../Pagination/PaginatedList";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import DeleteJobPopout from "../jobPopout/DeleteJobPopout";
|
import DeleteJobPopout from "../jobPopout/DeleteJobPopout";
|
||||||
import EditJobPopOut from "../jobPopout/EditJobPopout";
|
// import EditJobPopOut from "../jobPopout/EditJobPopout";
|
||||||
|
|
||||||
import DeleteIcon from "../../assets/images/icon-delete.svg";
|
import DeleteIcon from "../../assets/images/icon-delete.svg";
|
||||||
import EditIcon from "../../assets/images/icon-edit.svg";
|
import EditIcon from "../../assets/images/icon-edit.svg";
|
||||||
import { tableReload } from "../AddJob/settings";
|
import { tableReload } from "../AddJob/settings";
|
||||||
import CreditPopup from "../MyWallet/Popup/CreditPopup";
|
import CreditPopup from "../MyWallet/Popup/CreditPopup";
|
||||||
import JobListPopout from "../jobPopout/JobListPopout";
|
import JobListPopout from "../jobPopout/JobListPopout";
|
||||||
|
import EditJobPopoutNew from "../jobPopout/EditJobPopoutNew";
|
||||||
|
|
||||||
export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -103,7 +104,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const currentJobList = filterJobList();
|
const currentJobList = filterJobList()?.filter(item => item?.job_mode == 'GENERAL'); // Show only jobs with job mode of GENERAL
|
||||||
|
|
||||||
// Handling Filter Pagination
|
// Handling Filter Pagination
|
||||||
const filteredCurrentJobList = currentJobList?.slice(
|
const filteredCurrentJobList = currentJobList?.slice(
|
||||||
@@ -182,7 +183,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
{/* END of Delete Job Popout */}
|
{/* END of Delete Job Popout */}
|
||||||
|
|
||||||
{editJob.show && (
|
{editJob.show && (
|
||||||
<EditJobPopOut
|
<EditJobPopoutNew
|
||||||
details={editJob.data}
|
details={editJob.data}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
setEditJob({
|
setEditJob({
|
||||||
@@ -357,13 +358,14 @@ function myJobTableFeatures(
|
|||||||
{MyJobList?.data?.result_list?.length > 0 ? (
|
{MyJobList?.data?.result_list?.length > 0 ? (
|
||||||
filteredCurrentJobList.length > 0 ? (
|
filteredCurrentJobList.length > 0 ? (
|
||||||
filteredCurrentJobList.map((value, index) => (
|
filteredCurrentJobList.map((value, index) => (
|
||||||
<JobListItem
|
<JobListItem
|
||||||
key={index}
|
key={index}
|
||||||
index={index}
|
index={index}
|
||||||
value={value}
|
value={value}
|
||||||
image_server={MyJobList.data.session_image_server}
|
image_server={MyJobList.data.session_image_server}
|
||||||
/>
|
/>
|
||||||
))
|
)
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<NoJobsRow text="No Jobs Available In This Category!" />
|
<NoJobsRow text="No Jobs Available In This Category!" />
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -122,17 +122,43 @@ export default function MyJobTable({ className, ActiveJobList, Account, imageSer
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex justify-center items-center py-4 px-2">
|
<div className="flex justify-center items-center py-4 px-2">
|
||||||
<button
|
{accountType ?
|
||||||
type="button"
|
<button
|
||||||
onClick={() => {
|
type="button"
|
||||||
navigate("/manage-active-job", {
|
onClick={() => {
|
||||||
state: { ...task, pathname },
|
navigate("/manage-active-job", {
|
||||||
});
|
state: { ...task, pathname },
|
||||||
}}
|
});
|
||||||
className="px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
}}
|
||||||
>
|
className="px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
{task.owner_status == 'OWNER' ? 'Manage' : 'Send Updates'}
|
>
|
||||||
</button>
|
{task.owner_status == 'OWNER' ? 'Manage' : 'Send Updates'}
|
||||||
|
</button>
|
||||||
|
:
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/manage-active-job", {
|
||||||
|
state: { ...task, pathname },
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
className="w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 11 20"
|
||||||
|
id="Arrow"
|
||||||
|
className="w-[0.7rem]"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fillRule="evenodd"
|
||||||
|
d="M.366 19.708c.405.39 1.06.39 1.464 0l8.563-8.264a1.95 1.95 0 0 0 0-2.827L1.768.292A1.063 1.063 0 0 0 .314.282a.976.976 0 0 0-.011 1.425l7.894 7.617a.975.975 0 0 1 0 1.414L.366 18.295a.974.974 0 0 0 0 1.413"
|
||||||
|
// fill=""
|
||||||
|
className="color000000 svgShape fill-[#fff]"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -260,13 +260,13 @@ function AddFundDollars(props) {
|
|||||||
{/* switch button */}
|
{/* switch button */}
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<form className="add-fund-info flex items-center gap-3 md:px-8 md:pt-4 px-4 pt-2">
|
<form className="add-fund-info flex items-center gap-3 md:px-8 md:pt-4 px-4 pt-2">
|
||||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
<h1 className="job-label my-1">
|
||||||
{countryWallet == "US" && "Payment Method"}
|
{countryWallet == "US" && "Payment Method"}
|
||||||
</h1>
|
</h1>
|
||||||
<div className="my-1 flex items-center gap-2">
|
<div className="my-1 flex items-center gap-2">
|
||||||
<label
|
<label
|
||||||
htmlFor="previous"
|
htmlFor="previous"
|
||||||
className="cursor-pointer flex items-center gap-1"
|
className="flex items-center gap-1"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
@@ -283,7 +283,7 @@ function AddFundDollars(props) {
|
|||||||
</label>
|
</label>
|
||||||
<label
|
<label
|
||||||
htmlFor="new"
|
htmlFor="new"
|
||||||
className={`cursor-pointer flex items-center gap-1 ${
|
className={`flex items-center gap-1 ${
|
||||||
payListCards.data.length >= MaxNoOfCards
|
payListCards.data.length >= MaxNoOfCards
|
||||||
? "pointer-events-none"
|
? "pointer-events-none"
|
||||||
: ""
|
: ""
|
||||||
@@ -388,7 +388,7 @@ function AddFundDollars(props) {
|
|||||||
{/* Inputs */}
|
{/* Inputs */}
|
||||||
{/* Name */}
|
{/* Name */}
|
||||||
<div className="flex items-center field w-full my-2 flex-[0.4] gap-3">
|
<div className="flex items-center field w-full my-2 flex-[0.4] gap-3">
|
||||||
<label className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1">
|
<label className="job-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1">
|
||||||
Name:
|
Name:
|
||||||
</label>
|
</label>
|
||||||
<p className="input-label text-[#181c32] dark:text-white text-[16px] leading-[20.9625px] font-semibold flex items-center gap-1">{`${firstname} ${lastname}`}</p>
|
<p className="input-label text-[#181c32] dark:text-white text-[16px] leading-[20.9625px] font-semibold flex items-center gap-1">{`${firstname} ${lastname}`}</p>
|
||||||
@@ -423,7 +423,7 @@ function AddFundDollars(props) {
|
|||||||
className={`flex items-center justify-between mb-2.5`}
|
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 line-clamp-3 flex items-center"
|
className="job-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold line-clamp-3 flex items-center"
|
||||||
htmlFor="expiration"
|
htmlFor="expiration"
|
||||||
>
|
>
|
||||||
Exp Month{" "}
|
Exp Month{" "}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ function AddFundPop({
|
|||||||
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
|
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
|
||||||
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
||||||
<form className="md:px-8 md:pt-4 px-4 pt-2 add-fund-info flex items-center gap-[2.1rem]">
|
<form className="md:px-8 md:pt-4 px-4 pt-2 add-fund-info flex items-center gap-[2.1rem]">
|
||||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
<h1 className="job-label my-1">
|
||||||
Amount({currency})
|
Amount({currency})
|
||||||
</h1>
|
</h1>
|
||||||
<div className="field w-full max-w-[250px]">
|
<div className="field w-full max-w-[250px]">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="logout-modal-body w-full">
|
<div className="logout-modal-body w-full">
|
||||||
<div className="content-wrapper w-full h-[32rem]">
|
<div className="content-wrapper w-full h-[32rem] flex flex-col justify-center">
|
||||||
<div className="w-full mb-10">
|
<div className="w-full mb-10">
|
||||||
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
||||||
<div className="px-4 md:p-8 py-4 add-fund-info">
|
<div className="px-4 md:p-8 py-4 add-fund-info">
|
||||||
@@ -59,12 +59,12 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
|||||||
|
|
||||||
{data?.internal_return >= 0 &&
|
{data?.internal_return >= 0 &&
|
||||||
data?.result !== "Charge failed" && (
|
data?.result !== "Charge failed" && (
|
||||||
<div className="w-full md:w-[60%] mx-auto">
|
<div className="w-full max-w-[300px] mx-auto">
|
||||||
<div className="grid grid-cols-2 gap-8 my-2">
|
<div className="flex gap-8 my-2">
|
||||||
<h1 className="job-label">
|
<h1 className="w-full job-label">
|
||||||
Amount({data?.currency || ""})
|
Amount({data?.currency || ""})
|
||||||
</h1>
|
</h1>
|
||||||
<span className="w-full text-base text-dark-gray dark:text-white tracking-tighter flex justify-end items-end">
|
<span className="text-base text-dark-gray dark:text-white tracking-tighter flex justify-end items-end">
|
||||||
{`${data?.symbol || ""} ${
|
{`${data?.symbol || ""} ${
|
||||||
Number(data?.amount * 0.01).toFixed(2) || ""
|
Number(data?.amount * 0.01).toFixed(2) || ""
|
||||||
}`}
|
}`}
|
||||||
@@ -72,22 +72,22 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{data?.curr_balance &&
|
{data?.curr_balance &&
|
||||||
<div className="grid grid-cols-2 gap-8 my-2">
|
<div className="flex gap-8 my-2">
|
||||||
<h1 className="job-label">
|
<h1 className="w-full job-label">
|
||||||
Wallet Balance
|
Wallet Balance
|
||||||
</h1>
|
</h1>
|
||||||
<span className="w-full text-base text-dark-gray dark:text-white tracking-tighter flex justify-end items-end">
|
<span className="text-base text-dark-gray dark:text-white tracking-tighter flex justify-end items-end">
|
||||||
{(data?.curr_balance * 0.01).toFixed(2)}
|
{(data?.curr_balance * 0.01).toFixed(2)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
{isSuccess && (
|
{isSuccess && (
|
||||||
<div className="grid grid-cols-2 gap-8 my-2">
|
<div className="flex gap-8 my-2">
|
||||||
<h1 className="job-label">
|
<h1 className="w-full job-label">
|
||||||
Confirmation Number
|
Confirmation Number
|
||||||
</h1>
|
</h1>
|
||||||
<span className="w-full text-base text-dark-gray dark:text-white tracking-tighter flex justify-end items-end">
|
<span className="text-base text-dark-gray dark:text-white tracking-tighter flex justify-end items-end">
|
||||||
{data?.confirmation}
|
{data?.confirmation}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ function ThePaymentText({ value, type }) {
|
|||||||
return (
|
return (
|
||||||
<div className="my-2 flex items-center gap-5">
|
<div className="my-2 flex items-center gap-5">
|
||||||
<div className="card-details flex items-center gap-3">
|
<div className="card-details flex items-center gap-3">
|
||||||
<h1 className="text-xl font-normal text-dark-gray dark:text-white tracking-tighter my-1 space-x-1">
|
<h1 className="text-base">
|
||||||
{description} Card
|
{description} Card
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-xl font-normal text-dark-gray dark:text-white tracking-wide">
|
<p className="text-base font-normal text-dark-gray dark:text-white tracking-wide">
|
||||||
Bank **************{digits}
|
Bank **************{digits}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -49,10 +49,11 @@ function AmountSection({ currency, amount, country }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex items-center gap-8`}>
|
<div className={`flex items-center gap-8`}>
|
||||||
<h1 className="min-w-[150px] text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
{/* text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1 */}
|
||||||
|
<h1 className="min-w-[150px] job-label">
|
||||||
Amount({currency})
|
Amount({currency})
|
||||||
</h1>
|
</h1>
|
||||||
<span className="min-w-[100px] text-xl text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{formattedAmount}
|
{formattedAmount}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,10 +69,10 @@ function TransactionFeeSection({ currency, fee, country }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex items-center gap-8 border-b border-gray-600`}>
|
<div className={`flex items-center gap-8 border-b border-gray-600`}>
|
||||||
<h1 className="min-w-[150px] text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
<h1 className="min-w-[150px] job-label">
|
||||||
Transaction Fee
|
Transaction Fee
|
||||||
</h1>
|
</h1>
|
||||||
<span className="min-w-[100px] text-xl text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{formattedFee}
|
{formattedFee}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -89,10 +90,10 @@ function TotalSection({ currency, amount, fee, country }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex items-center gap-8`}>
|
<div className={`flex items-center gap-8`}>
|
||||||
<h1 className="min-w-[150px] text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
<h1 className="min-w-[150px] job-label">
|
||||||
Total
|
Total
|
||||||
</h1>
|
</h1>
|
||||||
<span className="min-w-[100px] text-xl text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{formattedTotal}
|
{formattedTotal}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -380,7 +381,7 @@ function ConfirmAddFund({
|
|||||||
<div className="flex items-center gap-8">
|
<div className="flex items-center gap-8">
|
||||||
<label
|
<label
|
||||||
htmlFor="payment"
|
htmlFor="payment"
|
||||||
className="min-w-[150px] text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1"
|
className="min-w-[150px] job-label"
|
||||||
>
|
>
|
||||||
Payment Method
|
Payment Method
|
||||||
</label>
|
</label>
|
||||||
@@ -395,11 +396,12 @@ function ConfirmAddFund({
|
|||||||
<div
|
<div
|
||||||
className={`gap-8 flex items-center`}
|
className={`gap-8 flex items-center`}
|
||||||
>
|
>
|
||||||
<h1 className="min-w-[150px] text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
<h1 className="min-w-[150px] job-label">
|
||||||
Reference No
|
Reference No
|
||||||
</h1>
|
</h1>
|
||||||
<span className="text-xl font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
<span className="text-base font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{__confirmData?.credit_reference}
|
{/* Displays only half of the string */}
|
||||||
|
{__confirmData?.credit_reference.slice(0, (Math.floor(__confirmData?.credit_reference.length/2)))}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {
|
|||||||
<ModalCom
|
<ModalCom
|
||||||
action={onClose}
|
action={onClose}
|
||||||
situation={situation}
|
situation={situation}
|
||||||
className="assign-task-popup"
|
|
||||||
>
|
>
|
||||||
<div className="logout-modal-wrapper w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
<div className="logout-modal-wrapper w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
<div className="modal-header-con">
|
<div className="modal-header-con">
|
||||||
|
|||||||
@@ -60,13 +60,6 @@ const WalletRoutes = () => {
|
|||||||
getPaymentHistory();
|
getPaymentHistory();
|
||||||
}, [walletTable]);
|
}, [walletTable]);
|
||||||
|
|
||||||
console.log(
|
|
||||||
"Testing all country: ",
|
|
||||||
allCountries,
|
|
||||||
"Testing wallet: ",
|
|
||||||
walletDetails
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function WalletAction({ walletItem, payment, openPopUp }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="counters w-full flex justify-between gap-2">
|
<div className="counters w-full flex justify-between gap-2">
|
||||||
<div className="w-1/2 flex justify-center items-center">
|
<div className="w-1/2 flex justify-start items-center">
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setShowNairaWithdraw((prev) => ({ ...prev, show: true }));
|
setShowNairaWithdraw((prev) => ({ ...prev, show: true }));
|
||||||
@@ -28,7 +28,7 @@ function WalletAction({ walletItem, payment, openPopUp }) {
|
|||||||
Spend
|
Spend
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-1/2 flex justify-center items-center">
|
<div className="w-1/2 flex justify-end items-center">
|
||||||
<button
|
<button
|
||||||
className="logout-btn btn-gradient text-white"
|
className="logout-btn btn-gradient text-white"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -38,7 +38,7 @@ function WalletAction({ walletItem, payment, openPopUp }) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span className="">Add Credit</span>
|
Add Credit
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ export default function WalletBox({ wallet, payment, countries }) {
|
|||||||
return (
|
return (
|
||||||
<div className="my-wallet-wrapper w-full mb-10">
|
<div className="my-wallet-wrapper w-full mb-10">
|
||||||
<div className="main-wrapper w-full">
|
<div className="main-wrapper w-full">
|
||||||
<div className="balance-inquery w-auto grid sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] gap-5 mb-11 h-auto">
|
<div className="balance-inquery w-auto grid md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] gap-5 mb-11 h-auto">
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="w-full h-full flex items-center justify-center">
|
<div className="w-full h-full flex items-center justify-center">
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
<LoadingSpinner size="16" color="sky-blue" />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
data.length > 0 && data.map((item) => (
|
data.length > 0 && data.map((item) => (
|
||||||
<div key={item.wallet_uid} className="lg:w-full h-full mb-10 lg:mb-0">
|
<div key={item.wallet_uid} className="w-full md:max-w-[450px] h-full mb-10 lg:mb-0">
|
||||||
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function RecentActivityTable({ payment }) {
|
|||||||
<thead className="border-b-2">
|
<thead className="border-b-2">
|
||||||
<tr className="text-slate-600">
|
<tr className="text-slate-600">
|
||||||
<th className="p-2">Date</th>
|
<th className="p-2">Date</th>
|
||||||
<th className="p-4">Trx.</th>
|
<th className="p-2">Trx.</th>
|
||||||
<th className="p-2">Amnt./Fee</th>
|
<th className="p-2">Amnt./Fee</th>
|
||||||
<th className="p-2">Status</th>
|
<th className="p-2">Status</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { useSelector } from "react-redux";
|
|||||||
|
|
||||||
export default function WalletHeader(props) {
|
export default function WalletHeader(props) {
|
||||||
|
|
||||||
const {userDetails: { account_type }} = useSelector((state) => state?.userDetails);
|
const {userDetails: { account_type, wallet_available_status }} = useSelector((state) => state?.userDetails);
|
||||||
// debugger;
|
// debugger;
|
||||||
//props.myWalletList.result_list
|
//props.myWalletList.result_list
|
||||||
let { pathname } = useLocation();
|
let { pathname } = useLocation();
|
||||||
@@ -22,6 +22,7 @@ export default function WalletHeader(props) {
|
|||||||
props.setBalanceDropdown.toggle();
|
props.setBalanceDropdown.toggle();
|
||||||
else navigate("/my-wallet", { replace: true });
|
else navigate("/my-wallet", { replace: true });
|
||||||
}
|
}
|
||||||
|
// console.log('props.myWalletList', wallet_available_status)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{account_type == 'FULL' ?
|
{account_type == 'FULL' ?
|
||||||
@@ -49,6 +50,8 @@ export default function WalletHeader(props) {
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="content px-7 pb-7">
|
<div className="content px-7 pb-7">
|
||||||
|
{/* wallet_available_status == 'WALLET_AVAILABLE' */}
|
||||||
|
{(wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE') ?
|
||||||
<ul>
|
<ul>
|
||||||
{props.myWalletList &&
|
{props.myWalletList &&
|
||||||
props.myWalletList?.length > 0 &&
|
props.myWalletList?.length > 0 &&
|
||||||
@@ -176,17 +179,25 @@ export default function WalletHeader(props) {
|
|||||||
{/* </div>*/}
|
{/* </div>*/}
|
||||||
{/*</li>*/}
|
{/*</li>*/}
|
||||||
</ul>
|
</ul>
|
||||||
|
:
|
||||||
|
<div className='p-2 w-full flex gap-4 items-center'>
|
||||||
|
<img className='w-[100px!important] h-auto' src={localImgLoad('images/icons/wallet.svg')} alt='Wallet Icon' />
|
||||||
|
<p className='text-lg text-red-500'>We do not currently support wallets in your area. We are diligently working on it. </p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
{(wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE') &&
|
||||||
<div className="add-money-btn flex justify-center items-center mt-3">
|
<div className="add-money-btn flex justify-center items-center mt-3">
|
||||||
{/* <button
|
{/* <button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if(pathname == '/my-wallet') props.setBalanceDropdown.toggle()
|
if(pathname == '/my-wallet') props.setBalanceDropdown.toggle()
|
||||||
else navigate('/my-wallet', {replace: true})
|
else navigate('/my-wallet', {replace: true})
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
Manage
|
Manage
|
||||||
</button> */}
|
</button> */}
|
||||||
<Link
|
<Link
|
||||||
to="/my-wallet"
|
to="/my-wallet"
|
||||||
onClick={onWalletClick}
|
onClick={onWalletClick}
|
||||||
@@ -195,6 +206,7 @@ export default function WalletHeader(props) {
|
|||||||
Manage
|
Manage
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className="current-balance-widget w-full h-full rounded-2xl overflow-hidden flex flex-col items-center gap-2 p-8 justify-between"
|
className="current-balance-widget w-full h-full rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between"
|
||||||
style={{
|
style={{
|
||||||
background: `url(${background}) 0% 0% / cover no-repeat`,
|
background: `url(${background}) 0% 0% / cover no-repeat`,
|
||||||
}}
|
}}
|
||||||
@@ -86,7 +86,7 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="my-2 w-full h-[1px] bg-white"></div>
|
<div className="w-full h-[1px] bg-white"></div>
|
||||||
|
|
||||||
<WalletAction
|
<WalletAction
|
||||||
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
|
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
|
||||||
|
|||||||
@@ -31,54 +31,34 @@ export default function Layout({ children }) {
|
|||||||
navigate("/login", { replace: true });
|
navigate("/login", { replace: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------
|
|
||||||
/* LET U DEAL WITH JOB LIST - we need to centralize this list */
|
|
||||||
// const {jobListTable} = useSelector((state) => state.tableReload)
|
|
||||||
// const [myJobList, setMyJobList] = useState({loading: true, data:[]});
|
|
||||||
// const api = new usersService();
|
|
||||||
|
|
||||||
// const getMyJobList = async () => {
|
|
||||||
// setMyJobList({loading: true, data:[]})
|
|
||||||
// try {
|
|
||||||
// const res = await api.getMyJobList();
|
|
||||||
// setMyJobList({loading: false, data:res.data})
|
|
||||||
// // setMyJobList(res.data);
|
|
||||||
// } catch (error) {
|
|
||||||
// setMyJobList({loading: false, data:[]})
|
|
||||||
// console.log("Error getting mode");
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// useEffect(() => {
|
|
||||||
// getMyJobList();
|
|
||||||
// }, [jobListTable]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="nft-main-wrapper-layout container mx-auto">
|
<div className="relative w-full max-w-[2000px] nft-main-wrapper-layout mx-auto">
|
||||||
<div className={`relative nft-wrapper-layout-container 2xl:pr-20 md:pr-10 pr-2 pl-2 md:pl-0 w-full min-h-screen flex`}>
|
<div className={`nft-wrapper-layout-container w-full min-h-screen flex`}>
|
||||||
{/* sidebar */}
|
{/* sidebar */}
|
||||||
<div className={`nft-sidebar xl:block hidden section-shadow ${drawer ? "2xl:w-[335px] w-[280px] 2xl:pl-20 pl-10 pr-6 " : "w-[70px]"} bg-white dark:bg-dark-white h-full overflow-y-scroll overflow-style-none fixed left-0 top-0 pt-[30px]`}>
|
<div className={`nft-sidebar xl:block hidden section-shadow ${drawer ? "2xl:w-[335px] w-[280px] 2xl:pl-20 pl-10 pr-6 " : "w-[70px]"} bg-white dark:bg-dark-white h-screen overflow-y-scroll overflow-style-none sticky left-0 top-0 pt-[30px]`}>
|
||||||
<Sidebar logoutModalHandler={logoutModalHandler} sidebar={drawer} action={() => dispatch(drawerToggle())} myJobList={userJobList} />
|
<Sidebar logoutModalHandler={logoutModalHandler} sidebar={drawer} action={() => dispatch(drawerToggle())} myJobList={userJobList} />
|
||||||
</div>
|
</div>
|
||||||
{MobileSideBar && (
|
{MobileSideBar && (
|
||||||
<div onClick={() => setMobileSidebar.toggle()} className="bg-black bg-opacity-20 fixed left-0 top-0 w-full h-full z-[50] block xl:hidden"></div>
|
<div onClick={() => setMobileSidebar.toggle()} className="bg-black bg-opacity-20 fixed left-0 top-0 w-full h-full z-[50] block xl:hidden"></div>
|
||||||
)}
|
)}
|
||||||
<div className={`nft-sidebar block xl:hidden section-shadow w-[280px] pl-3 bg-white dark:bg-dark-white h-full overflow-y-scroll overflow-style-none fixed z-[60] top-0 pt-8 ${MobileSideBar ? "left-0" : "-left-[290px]"}`}>
|
<div className={`nft-sidebar block xl:hidden section-shadow w-[280px] 2xl:pl-20 pl-10 pr-6 bg-white dark:bg-dark-white h-full overflow-y-scroll overflow-style-none fixed z-[60] top-0 pt-8 ${MobileSideBar ? "left-0" : "-left-[290px]"}`}>
|
||||||
<MobileSidebar logoutModalHandler={logoutModalHandler} sidebar={MobileSideBar} action={() => setMobileSidebar.toggle()} myJobList={userJobList} />
|
<MobileSidebar logoutModalHandler={logoutModalHandler} sidebar={MobileSideBar} action={() => setMobileSidebar.toggle()} myJobList={userJobList} />
|
||||||
</div>
|
</div>
|
||||||
{/* end sidebar */}
|
{/* end sidebar */}
|
||||||
<div className={`nft-header-container-wrapper flex-1 md:ml-10 ${drawer ? "2xl:ml-[375px] xl:ml-[310px]" : "xl:ml-[110px]"} h-full`}>
|
{/* FORMER CLASS NAME `w-full nft-header-container-wrapper ${drawer ? "2xl:ml-[335px] xl:ml-[280px]" : "xl:ml-[70px]"} h-full` */}
|
||||||
|
<div className={`w-full nft-header-container-wrapper h-full 2xl:px-10 px-8`}>
|
||||||
{/* header */}
|
{/* header */}
|
||||||
<div className="nft-header w-full lg:h-[100px] h-[70px] default-border-bottom dark:border-[#292967] z-40 xl:sticky fixed top-0 left-0 ">
|
<div className="nft-header w-full lg:h-[100px] h-[70px] default-border-bottom dark:border-[#292967] z-40 xl:sticky fixed top-0 left-0 ">
|
||||||
<Header sidebarHandler={() => setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
|
<Header sidebarHandler={() => setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
|
||||||
</div>
|
</div>
|
||||||
{/* container */}
|
{/* container */}
|
||||||
<div className="nft-container container mx-auto 2xl:flex 2xl:space-x-8 h-full mb-12 lg:mt-[140px] mt-24 xl:mt-10 flex flex-col xl:flex-row items-start justify-center gap-4">
|
<div className="nft-container 2xl:space-x-8 h-full mb-12 lg:mt-[140px] mt-24 xl:mt-10 flex flex-col items-start justify-center xl:flex-row xl:justify-between gap-4">
|
||||||
<div className="flex-[80%] w-full">
|
<div className="flex-[80%] 2xl:flex-[85%] w-full">
|
||||||
{children && children}
|
{children && children}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="nft-right-side-content 2xl:w-[270px] w-full h-full 2xl:flex justify-center relative flex-[20%]">
|
<div className="nft-right-side-content flex-[20%] 2xl:flex-[15%] w-full h-full 2xl:flex justify-center 2xl:justify-end relative">
|
||||||
<RightSideBar myJobList={userJobList} />
|
<RightSideBar myJobList={userJobList} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,7 +67,7 @@ export default function Layout({ children }) {
|
|||||||
</div>
|
</div>
|
||||||
{logoutModal && (
|
{logoutModal && (
|
||||||
<ModalCom action={logoutModalHandler} situation={logoutModal}>
|
<ModalCom action={logoutModalHandler} situation={logoutModal}>
|
||||||
<div className="logout-modal-wrapper w-11/12 sm:w-[460px] bg-white dark:bg-dark-white lg:rounded-2xl">
|
<div className="logout-modal-wrapper w-11/12 sm:w-[460px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
<div className="modal-header-con">
|
<div className="modal-header-con">
|
||||||
<h1 className="modal-title">
|
<h1 className="modal-title">
|
||||||
Confirm
|
Confirm
|
||||||
|
|||||||
@@ -53,22 +53,11 @@ export default function MediaLayout({backpath, title, children }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="nft-main-wrapper-layout media container mx-auto">
|
<div className="relative w-full max-w-[2000px] nft-main-wrapper-layout mx-auto">
|
||||||
<div className={`nft-wrapper-layout-container 2xl:pr-20 md:pr-10 pr-2 pl-2 md:pl-0 w-full min-h-screen flex`}>
|
<div className={`nft-wrapper-layout-container w-full min-h-screen flex`}>
|
||||||
{/* sidebar */}
|
<div className={`w-full nft-header-container-wrapper h-full 2xl:px-10 px-8`}>
|
||||||
{/*<div className={`nft-sidebar xl:block hidden section-shadow ${drawer ? "2xl:w-[335px] w-[280px] 2xl:pl-20 pl-10 pr-6 " : "w-[70px]"} bg-white dark:bg-dark-white h-full overflow-y-scroll overflow-style-none fixed left-0 top-0 pt-[30px]`}>*/}
|
|
||||||
{/* <Sidebar logoutModalHandler={logoutModalHandler} sidebar={drawer} action={() => dispatch(drawerToggle())} myJobList={userJobList} />*/}
|
|
||||||
{/*</div>*/}
|
|
||||||
{/*{MobileSideBar && (*/}
|
|
||||||
{/* <div onClick={() => setMobileSidebar.toggle()} className="bg-black bg-opacity-20 fixed left-0 top-0 w-full h-full z-[50] block xl:hidden"></div>*/}
|
|
||||||
{/*)}*/}
|
|
||||||
{/*<div className={`nft-sidebar block xl:hidden section-shadow w-[280px] pl-3 bg-white dark:bg-dark-white h-full overflow-y-scroll overflow-style-none fixed z-[60] top-0 pt-8 ${MobileSideBar ? "left-0" : "-left-[290px]"}`}>*/}
|
|
||||||
{/* <MobileSidebar logoutModalHandler={logoutModalHandler} sidebar={MobileSideBar} action={() => setMobileSidebar.toggle()} myJobList={userJobList} />*/}
|
|
||||||
{/*</div>*/}
|
|
||||||
{/* end sidebar */}
|
|
||||||
<div className={`nft-header-container-wrapper flex-1 md:ml-12 xl:ml-[110px] h-full`}>
|
|
||||||
{/* header */}
|
{/* header */}
|
||||||
<div className="nft-header w-full lg:h-[100px] h-[70px] default-border-bottom dark:border-[#292967] z-40 xl:sticky fixed top-0 left-0 ">
|
<div className="nft-header w-full lg:h-[100px] h-[70px] default-border-bottom dark:border-[#292967] z-40 xl:sticky fixed top-0 left-0">
|
||||||
<MediaHeader backpath={backpath} title={title} sidebarHandler={() => setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
|
<MediaHeader backpath={backpath} title={title} sidebarHandler={() => setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
|
||||||
</div>
|
</div>
|
||||||
{/* container */}
|
{/* container */}
|
||||||
@@ -76,9 +65,6 @@ export default function MediaLayout({backpath, title, children }) {
|
|||||||
<div className="nft-main-container_media flex-[100%] w-full">
|
<div className="nft-main-container_media flex-[100%] w-full">
|
||||||
{children && children}
|
{children && children}
|
||||||
</div>
|
</div>
|
||||||
{/*<div className="nft-right-side-content 2xl:w-[270px] w-full h-full 2xl:flex justify-center relative flex-[20%]">*/}
|
|
||||||
{/* <RightSideBar myJobList={userJobList} />*/}
|
|
||||||
{/*</div>*/}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ export default function MobileSidebar({
|
|||||||
const marketData = jobLists?.result_list;
|
const marketData = jobLists?.result_list;
|
||||||
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
|
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
|
||||||
|
|
||||||
|
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full h-full">
|
<div className="w-full h-full">
|
||||||
{/* logo-area */}
|
{/* logo-area */}
|
||||||
@@ -138,7 +140,7 @@ export default function MobileSidebar({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{userDetails?.account_type !== "FAMILY" && (
|
{(userDetails?.account_type !== "FAMILY" && walletExist) && (
|
||||||
<>
|
<>
|
||||||
{!userDetails?.post_jobs ? (
|
{!userDetails?.post_jobs ? (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -36,11 +36,12 @@ export default function RightSideBar({ myJobList }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="right-sidebar-wrapper overflow-y-scroll overflow-style-none 2xl:fixed h-full 2xl:pb-96">
|
<div className="right-sidebar-wrapper overflow-y-scroll overflow-style-none 2xl:fixed h-full 2xl:pb-96">
|
||||||
<div className="top-platform bg-white dark:bg-dark-white rounded-2xl p-8 2xl:w-[268px] w-full 2xl:mb-6 2xl:border-none border ">
|
<div className="top-platform bg-white dark:bg-dark-white rounded-2xl p-8 w-full 2xl:mb-6 2xl:border-none border ">
|
||||||
{/* heading */}
|
{/* heading */}
|
||||||
<div className="heading flex justify-between items-center mb-3.5">
|
<div className="heading flex justify-between items-center mb-3.5">
|
||||||
<h3 className="text-xl font-bold text-dark-gray dark:text-white">
|
<h3 className="text-xl font-bold text-dark-gray dark:text-white">
|
||||||
@@ -129,25 +130,27 @@ export default function RightSideBar({ myJobList }) {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="item flex space-x-3 items-center">
|
{ Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1 &&
|
||||||
{/* image */}
|
<div className="item flex space-x-3 items-center">
|
||||||
<div className="w-8 h-8 rounded-full bg-sky-500/50 p-1 flex justify-center items-center">
|
{/* image */}
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page">
|
<div className="w-8 h-8 rounded-full bg-sky-500/50 p-1 flex justify-center items-center">
|
||||||
<path
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page">
|
||||||
fillRule="evenodd"
|
<path
|
||||||
d="M0 13V2a2 2 0 0 1 2-2h64a2 2 0 0 1 2 2v11H0Zm0 4v31a2 2 0 0 0 2 2h20V17H0Zm26 33h40a2 2 0 0 0 2-2V17H26v33Z"
|
fillRule="evenodd"
|
||||||
fill="#ffffff"
|
d="M0 13V2a2 2 0 0 1 2-2h64a2 2 0 0 1 2 2v11H0Zm0 4v31a2 2 0 0 0 2 2h20V17H0Zm26 33h40a2 2 0 0 0 2-2V17H26v33Z"
|
||||||
className="color000000 svgShape"
|
fill="#ffffff"
|
||||||
></path>
|
className="color000000 svgShape"
|
||||||
</svg>
|
></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
{/* name */}
|
||||||
|
<div>
|
||||||
|
<p className="text-thin-light-gray text-base font-medium">
|
||||||
|
<NavLink to="/yourpage">My Page</NavLink>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* name */}
|
}
|
||||||
<div>
|
|
||||||
<p className="text-thin-light-gray text-base font-medium">
|
|
||||||
<NavLink to="/yourpage">My Page</NavLink>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -278,9 +281,9 @@ export default function RightSideBar({ myJobList }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/*JOB LINKS*/}
|
{/*JOB LINKS*/}
|
||||||
{userDetails?.account_type !== "FAMILY" &&
|
{(userDetails?.account_type !== "FAMILY" && walletExist) &&
|
||||||
myJobList?.data?.result_list?.length > 0 && (
|
myJobList?.data?.result_list?.length > 0 && (
|
||||||
<div className="top-platform mt-6 bg-white dark:bg-dark-white rounded-2xl py-8 2xl:w-[268px] w-full 2xl:mb-10 2xl:border-none border ">
|
<div className="top-platform mt-6 bg-white dark:bg-dark-white rounded-2xl py-8 w-full 2xl:mb-10 2xl:border-none border ">
|
||||||
{/* heading */}
|
{/* heading */}
|
||||||
<div className="px-8 heading flex justify-between items-center mb-3.5">
|
<div className="px-8 heading flex justify-between items-center mb-3.5">
|
||||||
<h3 className="text-xl font-bold text-dark-gray dark:text-white">
|
<h3 className="text-xl font-bold text-dark-gray dark:text-white">
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ export default function Sidebar({
|
|||||||
const marketData = jobLists?.result_list;
|
const marketData = jobLists?.result_list;
|
||||||
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
|
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
|
||||||
|
|
||||||
|
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const title = document.querySelectorAll(".menu-setting-items .heading");
|
const title = document.querySelectorAll(".menu-setting-items .heading");
|
||||||
if (sidebar) {
|
if (sidebar) {
|
||||||
@@ -157,7 +159,7 @@ export default function Sidebar({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{userDetails?.account_type !== "FAMILY" && (
|
{(userDetails?.account_type !== "FAMILY" && walletExist) && (
|
||||||
<>
|
<>
|
||||||
{!userDetails?.post_jobs ? (
|
{!userDetails?.post_jobs ? (
|
||||||
<div
|
<div
|
||||||
@@ -275,7 +277,7 @@ export default function Sidebar({
|
|||||||
<button
|
<button
|
||||||
onClick={logoutModalHandler}
|
onClick={logoutModalHandler}
|
||||||
type="button"
|
type="button"
|
||||||
className="signout-btn flex items-center space-x-1 p-2.5 w-2/3 h-[52px] bg-sky-blue transition duration-300 ease-in-out hover:bg-gray-900 rounded-full"
|
className="signout-btn flex items-center space-x-1 p-2.5 h-[52px] bg-sky-blue transition duration-300 ease-in-out hover:bg-gray-900 rounded-full"
|
||||||
>
|
>
|
||||||
<span className="">
|
<span className="">
|
||||||
<Icons name="new-logout" />
|
<Icons name="new-logout" />
|
||||||
|
|||||||
@@ -16,6 +16,22 @@ export default function MyUploadedFiles({ uploadedFiles }) {
|
|||||||
const handlePagination = (e) => {
|
const handlePagination = (e) => {
|
||||||
handlePagingFunc(e, setCurrentPage);
|
handlePagingFunc(e, setCurrentPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//FUNCTION TO OPEN NEW WINDOW
|
||||||
|
const openNewWindow = (e, url, width=1000, height=600) => {
|
||||||
|
e.preventDefault()
|
||||||
|
var leftPosition, topPosition;
|
||||||
|
//Allow for borders.
|
||||||
|
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
|
||||||
|
//Allow for title and status bars.
|
||||||
|
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
|
||||||
|
//Open the window.
|
||||||
|
window.open(url, "",
|
||||||
|
"status=no,height=" + height + ",width=" + width + ",resizable=yes,left="
|
||||||
|
+ leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY="
|
||||||
|
+ topPosition + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="mb-4 w-full flex justify-end item-center">
|
<div className="mb-4 w-full flex justify-end item-center">
|
||||||
@@ -44,7 +60,8 @@ export default function MyUploadedFiles({ uploadedFiles }) {
|
|||||||
currentFiles.map((value, idx) => {
|
currentFiles.map((value, idx) => {
|
||||||
let addedDate = value?.added?.split(" ")[0];
|
let addedDate = value?.added?.split(" ")[0];
|
||||||
let formattedSize = formatFileSize(value?.file_size);
|
let formattedSize = formatFileSize(value?.file_size);
|
||||||
let imageLink = `${uploadedFiles?.image}${localStorage.getItem('session_token')}/myfile/${value.file_uid}`
|
let downloadLink = value.file_type == 'video/mp4' ? `${process.env.REACT_APP_MEDIA_LINK}/myfile/${value.file_uid}` : `${uploadedFiles?.image}${localStorage.getItem('session_token')}/myfile/${value.file_uid}`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={value?.file_uid}
|
key={value?.file_uid}
|
||||||
@@ -103,8 +120,9 @@ export default function MyUploadedFiles({ uploadedFiles }) {
|
|||||||
<td className="text-right py-4 px-2">
|
<td className="text-right py-4 px-2">
|
||||||
<div className="flex justify-center items-center">
|
<div className="flex justify-center items-center">
|
||||||
<a
|
<a
|
||||||
href={imageLink}
|
href={downloadLink}
|
||||||
title="download"
|
title="download"
|
||||||
|
onClick={(e)=> openNewWindow(e, downloadLink)}
|
||||||
// className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
// className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -146,10 +146,12 @@ export default function UploadProduct({uploadTypes}) {
|
|||||||
|
|
||||||
let reqData = { // PAYLOAD FOR API CALL
|
let reqData = { // PAYLOAD FOR API CALL
|
||||||
// file_name: selectedFile.substring(0,21).replace(/ /gi, ""),
|
// file_name: selectedFile.substring(0,21).replace(/ /gi, ""),
|
||||||
|
|
||||||
|
// file_data: img.file?.split(",")[1],
|
||||||
file_name: `myfile.${imgDetails?.type?.split('/')[1]}`,
|
file_name: `myfile.${imgDetails?.type?.split('/')[1]}`,
|
||||||
file_size: imgDetails.size,
|
file_size: imgDetails.size,
|
||||||
file_type: imgDetails.type,
|
file_type: imgDetails.type,
|
||||||
file_data: img.file?.split(",")[1],
|
files: imgDetails,
|
||||||
title: itemName,
|
title: itemName,
|
||||||
description: description,
|
description: description,
|
||||||
msg_type: 'FILE',
|
msg_type: 'FILE',
|
||||||
@@ -173,7 +175,7 @@ export default function UploadProduct({uploadTypes}) {
|
|||||||
|
|
||||||
// API CALL TO UPLOAD COMES HERE
|
// API CALL TO UPLOAD COMES HERE
|
||||||
setRequestStatus({loading: true, status: null, message: ''}) // SETS REQUEST LOADING TRUE
|
setRequestStatus({loading: true, status: null, message: ''}) // SETS REQUEST LOADING TRUE
|
||||||
apiCall.sendFiles(reqData).then(res=>{
|
apiCall.uploadFile(reqData).then(res=>{
|
||||||
if(res.status != 200 || res.data.internal_return < 0){
|
if(res.status != 200 || res.data.internal_return < 0){
|
||||||
return setRequestStatus({loading: false, status: false, message: 'Something went wrong, try again'})
|
return setRequestStatus({loading: false, status: false, message: 'Something went wrong, try again'})
|
||||||
}
|
}
|
||||||
@@ -311,6 +313,13 @@ export default function UploadProduct({uploadTypes}) {
|
|||||||
className="w-full h-full object-cover"
|
className="w-full h-full object-cover"
|
||||||
controls
|
controls
|
||||||
></video>
|
></video>
|
||||||
|
) : img.type === "audio" ? (
|
||||||
|
<audio
|
||||||
|
type=""
|
||||||
|
src={img.file}
|
||||||
|
className="w-full h-full object-cover"
|
||||||
|
controls
|
||||||
|
></audio>
|
||||||
) : img.type != null ? (
|
) : img.type != null ? (
|
||||||
<p>{selectedFile}</p>
|
<p>{selectedFile}</p>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -434,6 +443,7 @@ export default function UploadProduct({uploadTypes}) {
|
|||||||
// to="/"
|
// to="/"
|
||||||
onClick={uploadItem}
|
onClick={uploadItem}
|
||||||
className="sm:w-[126px] h-[46px] w-[100px] flex justify-center items-center btn-gradient sm:text-18 text-sm rounded-full text-white"
|
className="sm:w-[126px] h-[46px] w-[100px] flex justify-center items-center btn-gradient sm:text-18 text-sm rounded-full text-white"
|
||||||
|
disabled={uploadTypes.loading || requestStatus.loading}
|
||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -0,0 +1,191 @@
|
|||||||
|
import React, { useEffect, useRef, useState } from 'react'
|
||||||
|
import LoadingSpinner from '../Spinners/LoadingSpinner'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import usersService from '../../services/UsersService'
|
||||||
|
|
||||||
|
export default function AttachFile({data='', fontSize='text-sm', showOnData=false}) {
|
||||||
|
|
||||||
|
const apiCall = new usersService()
|
||||||
|
|
||||||
|
let [uploadedList, setUploadedList] = useState({loading: true, data:{}})
|
||||||
|
let [reloadList, setReloadList] = useState(false) // Triggers list of upload reload
|
||||||
|
|
||||||
|
const [requestStatus, setRequestStatus] = useState({loading: false, status:false, message:''})
|
||||||
|
|
||||||
|
const inputFile = useRef()
|
||||||
|
|
||||||
|
const upload = (event) => {
|
||||||
|
let inputs = {
|
||||||
|
file: event.target.files[0],
|
||||||
|
job_uid: data?.job_uid,
|
||||||
|
// uid: localStorage.getItem("uid"),
|
||||||
|
// member_id: localStorage.getItem("member_id"),
|
||||||
|
// sessionid: localStorage.getItem("session_token"),
|
||||||
|
};
|
||||||
|
setRequestStatus({loading: true, status:false, message:''})
|
||||||
|
if(!inputs.file){
|
||||||
|
setRequestStatus({loading: false, status:false, message:'Please select a file'})
|
||||||
|
setTimeout(()=>{
|
||||||
|
setRequestStatus({loading: false, status:false, message:''})
|
||||||
|
}, 3000)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// const formData = new FormData()
|
||||||
|
// for (let input in inputs) {
|
||||||
|
// formData.append(input, inputs[input]);
|
||||||
|
// }
|
||||||
|
apiCall.uploadTaskFile(inputs).then(res => {
|
||||||
|
if(res.data.internal_return < 0){
|
||||||
|
inputFile.current.value = null
|
||||||
|
setRequestStatus({loading: false, status:false, message:'upload failed'})
|
||||||
|
setTimeout(()=>{
|
||||||
|
setRequestStatus({loading: false, status:false, message:''})
|
||||||
|
}, 3000)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setRequestStatus({loading: false, status:true, message:'uploaded'})
|
||||||
|
inputFile.current.value = null
|
||||||
|
setReloadList(prev => !prev) // Triggers list of upload reload
|
||||||
|
setTimeout(()=>{
|
||||||
|
setRequestStatus({loading: false, status:false, message:''})
|
||||||
|
}, 3000)
|
||||||
|
}).catch(err => {
|
||||||
|
inputFile.current.value = null
|
||||||
|
setRequestStatus({loading: false, status:false, message:'upload failed'})
|
||||||
|
setTimeout(()=>{
|
||||||
|
setRequestStatus({loading: false, status:false, message:''})
|
||||||
|
}, 3000)
|
||||||
|
return
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//FUNCTION TO OPEN NEW WINDOW
|
||||||
|
const openNewWindow = (e, url, width=1000, height=600) => {
|
||||||
|
e.preventDefault()
|
||||||
|
var leftPosition, topPosition;
|
||||||
|
//Allow for borders.
|
||||||
|
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
|
||||||
|
//Allow for title and status bars.
|
||||||
|
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
|
||||||
|
//Open the window.
|
||||||
|
window.open(url, "",
|
||||||
|
"status=no,height=" + height + ",width=" + width + ",resizable=yes,left="
|
||||||
|
+ leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY="
|
||||||
|
+ topPosition + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
apiCall.jobManagerFiles({job_uid:data?.job_uid || data?.origin_job_uid}).then(res => {
|
||||||
|
setUploadedList({loading: false, data:res.data})
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
setUploadedList({loading: false, data:{}})
|
||||||
|
})
|
||||||
|
},[data, reloadList])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{!showOnData ?
|
||||||
|
<div className='w-full h-full flex flex-col justify-center items-center'>
|
||||||
|
<div className='w-full flex flex-col items-start gap-1 overflow-hidden'>
|
||||||
|
<div className='w-full flex justify-between items-center gap-1'>
|
||||||
|
<div className='job-label job-label-flex'>
|
||||||
|
Files {
|
||||||
|
requestStatus.loading ?
|
||||||
|
<LoadingSpinner size='6' />
|
||||||
|
:
|
||||||
|
<span className={`text-[10px] ${requestStatus.status ? 'text-emerald-600' : 'text-red-500'}`}>{requestStatus.message}</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<label htmlFor='file' className={`text-black bg-[#f8ffd4] cursor-pointer text-[12px] py-1 px-2 rounded-full border ${ requestStatus.loading && 'pointer-events-none'}`}>+ Add Files</label>
|
||||||
|
</div>
|
||||||
|
<div className='w-full p-2 rounded-2xl bg-slate-100'>
|
||||||
|
<div className='text-[12px] w-full h-20 overflow-y-auto flex flex-col gap-2'>
|
||||||
|
{uploadedList.loading ?
|
||||||
|
<div className='w-full h-full justify-center items-center'>
|
||||||
|
<LoadingSpinner size='6' height='h-full' />
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
Object.keys(uploadedList.data).length > 0 ?
|
||||||
|
uploadedList.data.result_list.length > 0 ?
|
||||||
|
uploadedList.data.result_list.map((item, index) => {
|
||||||
|
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
||||||
|
let downloadLink = fileNameExt == 'mp4' ? `${process.env.REACT_APP_MEDIA_LINK}/mytask/${item.file_uid}` : `${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`
|
||||||
|
return(
|
||||||
|
<div key={item.file_uid} className={`mb-[6px] flex justify-start gap-2 ${fontSize}`}>
|
||||||
|
<span>{index + 1}:</span>
|
||||||
|
<a
|
||||||
|
target='_blank'
|
||||||
|
alt='download-link'
|
||||||
|
className=''
|
||||||
|
href={downloadLink}
|
||||||
|
onClick={(e)=> openNewWindow(e, downloadLink)}
|
||||||
|
>
|
||||||
|
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
:
|
||||||
|
<p className='text-sm'>No Uploaded files yet</p>
|
||||||
|
:
|
||||||
|
<></>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
id='file'
|
||||||
|
ref={inputFile}
|
||||||
|
className='hidden file:rounded-full job-label p-1'
|
||||||
|
onChange={upload}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
:showOnData && uploadedList?.data?.result_list?.length > 0 ?
|
||||||
|
<div className='w-full h-full flex flex-col justify-center items-center'>
|
||||||
|
<div className='w-full flex flex-col items-start gap-1 overflow-hidden'>
|
||||||
|
<div className='w-full flex justify-between items-center gap-1'>
|
||||||
|
<div className='job-label job-label-flex'>
|
||||||
|
Files
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className='w-full p-2 rounded-2xl bg-slate-100'>
|
||||||
|
<div className='text-[12px] w-full p-2 h-20 overflow-y-auto flex flex-col gap-2'>
|
||||||
|
{uploadedList.data.result_list.map((item, index) => {
|
||||||
|
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
||||||
|
let downloadLink = fileNameExt == 'mp4' ? `${process.env.REACT_APP_MEDIA_LINK}/mytask/${item.file_uid}` : `${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`
|
||||||
|
return(
|
||||||
|
<div key={item.file_uid} className={`mb-[6px] flex justify-start gap-2 ${fontSize}`}>
|
||||||
|
<span>{index + 1}:</span>
|
||||||
|
<a
|
||||||
|
target='_blank'
|
||||||
|
alt='download-link'
|
||||||
|
className=''
|
||||||
|
href={downloadLink}
|
||||||
|
onClick={(e)=> openNewWindow(e, downloadLink)}
|
||||||
|
>
|
||||||
|
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
id='file'
|
||||||
|
ref={inputFile}
|
||||||
|
className='hidden file:rounded-full job-label p-1'
|
||||||
|
onChange={upload}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<></>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -6,12 +6,14 @@ export default function CustomTimer({className='text-emerald-500'}) {
|
|||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
const timer = setInterval(()=>{
|
const timer = setInterval(()=>{
|
||||||
setTime(prev => prev - 1)
|
if(time > 0 ){
|
||||||
|
setTime(prev => prev - 1)
|
||||||
|
}
|
||||||
},1000)
|
},1000)
|
||||||
return ()=>{
|
return ()=>{
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
}
|
}
|
||||||
},[])
|
},[time])
|
||||||
|
|
||||||
let minutes = time == 0 ? 0 : Math.floor(time/60)
|
let minutes = time == 0 ? 0 : Math.floor(time/60)
|
||||||
let seconds = time == 0 ? 0 :time - (minutes * 60)
|
let seconds = time == 0 ? 0 :time - (minutes * 60)
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function TabButton({ item='', selectedTab='', setSelectedTab=()=>{} }) {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
className={`px-4 py-1 rounded-t-2xl border-t-[2px] transition-all duration-200 flex flex-col justify-center items-center ${
|
||||||
|
selectedTab === item
|
||||||
|
? "bg-red-50 dark:bg-[#D85A5A] text-slate-600 font-extrabold"
|
||||||
|
: "bg-white text-[#000]"
|
||||||
|
}`}
|
||||||
|
value={item}
|
||||||
|
name={item}
|
||||||
|
onClick={() => setSelectedTab(item)}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={`mb-[1px] h-6 w-6 border-4 rounded-full transition-all duration-200 ${
|
||||||
|
selectedTab === item
|
||||||
|
? "border-white bg-emerald-500"
|
||||||
|
: "border-red-50 dark:border-[#D85A5A] bg-white"
|
||||||
|
}`}
|
||||||
|
></div>
|
||||||
|
{item[0].toUpperCase() + item.slice(1)}
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ function DeleteJobPopout({ details, onClose, situation }) {
|
|||||||
{/* End of error or success display */}
|
{/* End of error or success display */}
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-footer-wrapper grid grid-cols-1 xxs:grid-cols-3">
|
<div className="modal-footer-wrapper grid grid-cols-1 xxs:grid-cols-3">
|
||||||
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center">
|
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center gap-4">
|
||||||
<button
|
<button
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -211,315 +211,314 @@ 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="modal-header-con">
|
|
||||||
<h1 className="modal-title">
|
|
||||||
Edit Job
|
|
||||||
</h1>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="modal-close-btn"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
width="36"
|
|
||||||
height="36"
|
|
||||||
viewBox="0 0 36 36"
|
|
||||||
fill="none"
|
|
||||||
className="fill-current"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
|
||||||
fill=""
|
|
||||||
fillOpacity="0.6"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
|
||||||
fill="#"
|
|
||||||
fillOpacity="0.6"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
validationSchema={validationSchema}
|
validationSchema={validationSchema}
|
||||||
onSubmit={handleEditJob}
|
onSubmit={handleEditJob}
|
||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Form className="w-full">
|
<Form className="">
|
||||||
<div className="logout-modal-body w-full flex flex-col items-center px-10 pb-8 pt-2">
|
<div className="modal-container">
|
||||||
<div className="flex flex-col-reverse sm:flex-row">
|
<div className="modal-header-con">
|
||||||
<div className="fields w-full">
|
<h1 className="modal-title">
|
||||||
<div className="xl:flex xl:space-x-7 mb-[0.5rem]">
|
Edit Job
|
||||||
<div className="field w-full mb-6 xl:mb-0">
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="modal-close-btn"
|
||||||
|
onClick={onClose}
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
width="36"
|
||||||
|
height="36"
|
||||||
|
viewBox="0 0 36 36"
|
||||||
|
fill="none"
|
||||||
|
className="fill-current"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
||||||
|
fill=""
|
||||||
|
fillOpacity="0.6"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
||||||
|
fill="#"
|
||||||
|
fillOpacity="0.6"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="modal-body-wrapper">
|
||||||
|
<div className="flex flex-col-reverse sm:flex-row">
|
||||||
|
<div className="fields w-full">
|
||||||
|
<div className="xl:flex xl:space-x-7 mb-[0.5rem]">
|
||||||
|
<div className="field w-full mb-6 xl:mb-0">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6 cursor-default"
|
||||||
|
label="Currency"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="country"
|
||||||
|
value={props.values.country}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
blurHandler={props.handleBlur}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Price */}
|
||||||
|
<div className="field w-full">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6 text-right"
|
||||||
|
label="Price"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="number"
|
||||||
|
name="price"
|
||||||
|
value={props.values.price}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
blurHandler={props.handleBlur}
|
||||||
|
errorBorder={
|
||||||
|
props.errors.price && props.touched.price
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* Title */}
|
||||||
|
<div className="field w-full mb-[0.5rem]">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6 cursor-default"
|
fieldClass="px-6"
|
||||||
label="Currency"
|
label="Title"
|
||||||
labelClass="tracking-wide"
|
labelClass="tracking-wide"
|
||||||
inputBg="bg-slate-100"
|
inputBg="bg-slate-100"
|
||||||
inputClass="input-curve lg border border-light-purple"
|
inputClass=" input-curve lg border border-light-purple"
|
||||||
type="text"
|
type="text"
|
||||||
name="country"
|
name="title"
|
||||||
value={props.values.country}
|
value={props.values.title}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
disable={true}
|
errorBorder={props.errors.title && props.touched.title}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Price */}
|
{/* Description */}
|
||||||
<div className="field w-full">
|
<div className="field w-full mb-[0.5rem]">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6 text-right"
|
fieldClass="px-6"
|
||||||
label="Price"
|
label="Description"
|
||||||
labelClass="tracking-wide"
|
labelClass="tracking-wide"
|
||||||
inputBg="bg-slate-100"
|
inputBg="bg-slate-100"
|
||||||
inputClass="input-curve lg border border-light-purple"
|
inputClass=" input-curve lg border border-light-purple"
|
||||||
type="number"
|
type="text"
|
||||||
name="price"
|
name="description"
|
||||||
value={props.values.price}
|
value={props.values.description}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
errorBorder={
|
errorBorder={
|
||||||
props.errors.price && props.touched.price
|
props.errors.description && props.touched.description
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{/* Title */}
|
|
||||||
<div className="field w-full mb-[0.5rem]">
|
|
||||||
<InputCom
|
|
||||||
fieldClass="px-6"
|
|
||||||
label="Title"
|
|
||||||
labelClass="tracking-wide"
|
|
||||||
inputBg="bg-slate-100"
|
|
||||||
inputClass=" input-curve lg border border-light-purple"
|
|
||||||
type="text"
|
|
||||||
name="title"
|
|
||||||
value={props.values.title}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
blurHandler={props.handleBlur}
|
|
||||||
errorBorder={props.errors.title && props.touched.title}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Description */}
|
{/* Details */}
|
||||||
<div className="field w-full mb-[0.5rem]">
|
<div className="field flex flex-col sm:flex-row w-full mb-[5px] gap-2">
|
||||||
<InputCom
|
<div className="sm:w-[60%] w-full">
|
||||||
fieldClass="px-6"
|
<label
|
||||||
label="Description"
|
htmlFor="job-label"
|
||||||
labelClass="tracking-wide"
|
className='job-label'
|
||||||
inputBg="bg-slate-100"
|
>
|
||||||
inputClass=" input-curve lg border border-light-purple"
|
Job Delivery Details
|
||||||
type="text"
|
</label>
|
||||||
name="description"
|
<textarea
|
||||||
value={props.values.description}
|
id="Job Delivery Details"
|
||||||
inputHandler={props.handleChange}
|
rows="5"
|
||||||
blurHandler={props.handleBlur}
|
className={`input-field px-6 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] ${
|
||||||
errorBorder={
|
props.errors.job_detail && props.touched.job_detail
|
||||||
props.errors.description && props.touched.description
|
? "border-[#ff0a0a63] shadow-red-500 border-[0.5px] animate-shake"
|
||||||
}
|
: "border border-[#f5f8fa] dark:border-[#5e6278]"
|
||||||
/>
|
} rounded-[10px]`}
|
||||||
</div>
|
style={{ resize: "none" }}
|
||||||
|
name="job_detail"
|
||||||
{/* Details */}
|
value={props.values.job_detail}
|
||||||
<div className="field flex flex-col sm:flex-row w-full mb-[5px] gap-2">
|
onChange={props.handleChange}
|
||||||
<div className="sm:w-[60%] w-full">
|
onBlur={props.handleBlur}
|
||||||
<label
|
/>
|
||||||
htmlFor="job-label"
|
|
||||||
className='job-label'
|
|
||||||
>
|
|
||||||
Job Delivery Details
|
|
||||||
</label>
|
|
||||||
<textarea
|
|
||||||
id="Job Delivery Details"
|
|
||||||
rows="5"
|
|
||||||
className={`input-field px-6 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] ${
|
|
||||||
props.errors.job_detail && props.touched.job_detail
|
|
||||||
? "border-[#ff0a0a63] shadow-red-500 border-[0.5px] animate-shake"
|
|
||||||
: "border border-[#f5f8fa] dark:border-[#5e6278]"
|
|
||||||
} rounded-[10px]`}
|
|
||||||
style={{ resize: "none" }}
|
|
||||||
name="job_detail"
|
|
||||||
value={props.values.job_detail}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
onBlur={props.handleBlur}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="sm:w-[35%] w-full">
|
|
||||||
<div
|
|
||||||
htmlFor="Job Categories"
|
|
||||||
className='job-label'
|
|
||||||
id="checked-group"
|
|
||||||
>
|
|
||||||
Categories
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
className="sm:flex-col flex flex-wrap px-3 mt-3"
|
<div className="sm:w-[35%] w-full">
|
||||||
role="group"
|
<div
|
||||||
aria-labelledby="checked-group"
|
htmlFor="Job Categories"
|
||||||
>
|
className='job-label'
|
||||||
{categories &&
|
id="checked-group"
|
||||||
Object.entries(categories)?.map(([key, value]) => (
|
>
|
||||||
<label
|
Categories
|
||||||
key={key}
|
</div>
|
||||||
className="flex gap-1 w-full items-center dark:text-white"
|
<div
|
||||||
>
|
className="sm:flex-col flex flex-wrap px-3 mt-3"
|
||||||
<Field
|
role="group"
|
||||||
type="checkbox"
|
aria-labelledby="checked-group"
|
||||||
name="category"
|
>
|
||||||
value={key}
|
{categories &&
|
||||||
/>
|
Object.entries(categories)?.map(([key, value]) => (
|
||||||
<span className="text-[13.975px]">{value}</span>
|
<label
|
||||||
</label>
|
key={key}
|
||||||
))}
|
className="flex gap-1 w-full items-center dark:text-white"
|
||||||
<span className="h-5 text-sm italic text-[#cf3917]">
|
>
|
||||||
{props.errors.category &&
|
<Field
|
||||||
props.touched.category &&
|
type="checkbox"
|
||||||
"please select a category"}
|
name="category"
|
||||||
</span>
|
value={key}
|
||||||
</div>
|
/>
|
||||||
</div>
|
<span className="text-[13.975px]">{value}</span>
|
||||||
</div>
|
</label>
|
||||||
<div className="w-full flex items-center gap-2 mb-2">
|
))}
|
||||||
{/* FOR TASK IMAGE */}
|
<span className="h-5 text-sm italic text-[#cf3917]">
|
||||||
<div className="w-1/2 relative max-h-[130px] min-h-[130px]">
|
{props.errors.category &&
|
||||||
<input
|
props.touched.category &&
|
||||||
id="task_image"
|
"please select a category"}
|
||||||
className="hidden"
|
|
||||||
type="file"
|
|
||||||
accept="image/*"
|
|
||||||
onChange={taskImgChangeHandler}
|
|
||||||
/>
|
|
||||||
{taskImage ? (
|
|
||||||
<div className="w-full absolute -top-5">
|
|
||||||
<img
|
|
||||||
src={taskImage}
|
|
||||||
className="max-h-[150px] min-h-[150px] w-full object-cover"
|
|
||||||
alt="uploaded task"
|
|
||||||
/>
|
|
||||||
<span
|
|
||||||
onClick={() => setTaskImage("")}
|
|
||||||
className="p-2 absolute text-sm top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white/80 hover:bg-white hover:shadow-md transition-all duration-500 cursor-pointer text-slate-800"
|
|
||||||
>
|
|
||||||
Remove Image
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
|
||||||
<label
|
|
||||||
className="absolute -top-5 h-[150px] w-full flex flex-col justify-center items-center bg-slate-100 dark:bg-[#11131F] cursor-pointer input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold"
|
|
||||||
htmlFor="task_image"
|
|
||||||
>
|
|
||||||
Select Task Image
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{/* END OF TASK IMAGE */}
|
|
||||||
|
|
||||||
<div className="field w-1/2">
|
|
||||||
<div className={`flex items-center justify-between`}>
|
|
||||||
<label
|
|
||||||
className="job-label flex flex-col"
|
|
||||||
htmlFor="timeline_days"
|
|
||||||
>
|
|
||||||
Timeline -
|
|
||||||
<span className="w-full text-center text-green-700 text-sm tracking-wide">
|
|
||||||
Expected duration of this task
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<Field
|
<div className="w-full flex items-center gap-2 mb-2">
|
||||||
component="select"
|
{/* FOR TASK IMAGE */}
|
||||||
name="timeline_days"
|
<div className="w-1/2 relative max-h-[130px] min-h-[130px]">
|
||||||
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none ${
|
<input
|
||||||
props.errors.timeline_days &&
|
id="task_image"
|
||||||
props.touched.timeline_days
|
className="hidden"
|
||||||
? "border-[#ff0a0a63] shadow-red-500 border-[0.5px] animate-shake"
|
type="file"
|
||||||
: "border border-[#f5f8fa] dark:border-[#5e6278]"
|
accept="image/*"
|
||||||
}`}
|
onChange={taskImgChangeHandler}
|
||||||
value={props.values.timeline_days}
|
/>
|
||||||
>
|
{taskImage ? (
|
||||||
<option value="">Select Duration</option>
|
<div className="w-full absolute -top-5">
|
||||||
{publicArray.map(({ name, duration }, idx) => (
|
<img
|
||||||
<option
|
src={taskImage}
|
||||||
key={duration}
|
className="max-h-[150px] min-h-[150px] w-full object-cover"
|
||||||
className="text-slate-500 text-lg"
|
alt="uploaded task"
|
||||||
value={duration}
|
/>
|
||||||
|
<span
|
||||||
|
onClick={() => setTaskImage("")}
|
||||||
|
className="p-2 absolute text-sm top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white/80 hover:bg-white hover:shadow-md transition-all duration-500 cursor-pointer text-slate-800"
|
||||||
|
>
|
||||||
|
Remove Image
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<label
|
||||||
|
className="absolute -top-5 h-[150px] w-full flex flex-col justify-center items-center bg-slate-100 dark:bg-[#11131F] cursor-pointer input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold"
|
||||||
|
htmlFor="task_image"
|
||||||
>
|
>
|
||||||
{name}
|
Select Task Image
|
||||||
</option>
|
</label>
|
||||||
))}
|
)}
|
||||||
</Field>
|
</div>
|
||||||
|
{/* END OF TASK IMAGE */}
|
||||||
|
|
||||||
|
<div className="field w-1/2">
|
||||||
|
<div className={`flex items-center justify-between`}>
|
||||||
|
<label
|
||||||
|
className="job-label flex flex-col"
|
||||||
|
htmlFor="timeline_days"
|
||||||
|
>
|
||||||
|
Timeline -
|
||||||
|
<span className="w-full text-center text-green-700 text-sm tracking-wide">
|
||||||
|
Expected duration of this task
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
component="select"
|
||||||
|
name="timeline_days"
|
||||||
|
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none ${
|
||||||
|
props.errors.timeline_days &&
|
||||||
|
props.touched.timeline_days
|
||||||
|
? "border-[#ff0a0a63] shadow-red-500 border-[0.5px] animate-shake"
|
||||||
|
: "border border-[#f5f8fa] dark:border-[#5e6278]"
|
||||||
|
}`}
|
||||||
|
value={props.values.timeline_days}
|
||||||
|
>
|
||||||
|
<option value="">Select Duration</option>
|
||||||
|
{publicArray.map(({ name, duration }, idx) => (
|
||||||
|
<option
|
||||||
|
key={duration}
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value={duration}
|
||||||
|
>
|
||||||
|
{name}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</Field>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* inputs ends here */}
|
||||||
</div>
|
</div>
|
||||||
{/* inputs ends here */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
<div className="content-footer w-full">
|
||||||
<div className="content-footer w-full">
|
{/* error or success display */}
|
||||||
{/* error or success display */}
|
{requestStatus.message != "" &&
|
||||||
{requestStatus.message != "" &&
|
(!requestStatus.status ? (
|
||||||
(!requestStatus.status ? (
|
|
||||||
<div
|
|
||||||
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
|
||||||
>
|
|
||||||
{requestStatus.message}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
requestStatus.status && (
|
|
||||||
<div
|
<div
|
||||||
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
>
|
>
|
||||||
{requestStatus.message}
|
{requestStatus.message}
|
||||||
</div>
|
</div>
|
||||||
)
|
) : (
|
||||||
))}
|
requestStatus.status && (
|
||||||
{/* End of error or success display */}
|
<div
|
||||||
|
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
|
>
|
||||||
|
{requestStatus.message}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
{/* End of error or success display */}
|
||||||
|
|
||||||
|
{/* DISPLAYS TASK IMAGE UPLOADING STATUS */}
|
||||||
|
<div className="w-full">
|
||||||
|
{uploadStatus.message && !uploadStatus.loading && (
|
||||||
|
<p
|
||||||
|
className={`text-center ${
|
||||||
|
uploadStatus.status
|
||||||
|
? "text-green-500"
|
||||||
|
: "text-red-500"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{uploadStatus.message}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
{uploadStatus.loading && (
|
||||||
|
<p className="text-center">{uploadStatus.message}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* DISPLAYS TASK IMAGE UPLOADING STATUS */}
|
|
||||||
<div className="w-full">
|
|
||||||
{uploadStatus.message && !uploadStatus.loading && (
|
|
||||||
<p
|
|
||||||
className={`text-center ${
|
|
||||||
uploadStatus.status
|
|
||||||
? "text-green-500"
|
|
||||||
: "text-red-500"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{uploadStatus.message}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
{uploadStatus.loading && (
|
|
||||||
<p className="text-center">{uploadStatus.message}</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="modal-footer-wrapper justify-end">
|
||||||
<div className="modal-footer-wrapper justify-end">
|
{requestStatus.loading ? (
|
||||||
{requestStatus.loading ? (
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
) : (
|
||||||
) : (
|
<button
|
||||||
<button
|
type="submit"
|
||||||
type="submit"
|
className="custom-btn btn-gradient text-white"
|
||||||
className="w-[120px] h-[40px] flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
disabled={
|
||||||
// className='w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'
|
requestStatus.loading || uploadStatus.loading
|
||||||
disabled={
|
}
|
||||||
requestStatus.loading || uploadStatus.loading
|
>
|
||||||
}
|
Save
|
||||||
>
|
</button>
|
||||||
Save
|
)}
|
||||||
</button>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
</div>
|
|
||||||
</ModalCom>
|
</ModalCom>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,541 @@
|
|||||||
|
import { Field, Form, Formik } from "formik";
|
||||||
|
import React, { useCallback, useMemo, useState } from "react";
|
||||||
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import * as Yup from "yup";
|
||||||
|
import usersService from "../../services/UsersService";
|
||||||
|
import { tableReload } from "../../store/TableReloads";
|
||||||
|
import InputCom from "../Helpers/Inputs/InputCom";
|
||||||
|
import ModalCom from "../Helpers/ModalCom";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
import { apiConst } from "../../lib/apiConst";
|
||||||
|
import AttachFile from "../attachmentCom/AttachFile";
|
||||||
|
|
||||||
|
const validationSchema = Yup.object().shape({
|
||||||
|
country: Yup.string()
|
||||||
|
.min(1, "Minimum 3 characters")
|
||||||
|
.max(25, "Maximum 25 characters")
|
||||||
|
.required("Country is required"),
|
||||||
|
price: Yup.string()
|
||||||
|
.typeError("Invalid number")
|
||||||
|
.min(1, "Price must be greater than 0")
|
||||||
|
.test("no-e", "Invalid number", (value) => {
|
||||||
|
if (value && /\d+e/.test(value)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.required("Price is required"),
|
||||||
|
title: Yup.string()
|
||||||
|
.min(5, "Minimum 5 characters")
|
||||||
|
.max(149, "Maximum 149 characters")
|
||||||
|
.required("Title is required"),
|
||||||
|
description: Yup.string()
|
||||||
|
.min(5, "Minimum 5 characters")
|
||||||
|
.max(299, "Maximum 299 characters")
|
||||||
|
.required("Description is required"),
|
||||||
|
job_detail: Yup.string()
|
||||||
|
.min(3, "Minimum 3 characters")
|
||||||
|
.max(1440, "Maximum 1440 characters")
|
||||||
|
.required("Details is required"),
|
||||||
|
timeline_days: Yup.number()
|
||||||
|
.typeError("you must specify a number")
|
||||||
|
.min(1, "Price must be greater than 0")
|
||||||
|
.required("Timeline is required"),
|
||||||
|
category: Yup.array().min(1, "Select at least one checkbox"),
|
||||||
|
});
|
||||||
|
|
||||||
|
const EditJobPopoutNew = ({
|
||||||
|
details,
|
||||||
|
onClose,
|
||||||
|
situation,
|
||||||
|
country,
|
||||||
|
categories,
|
||||||
|
}) => {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
|
const { walletDetails } = useSelector((state) => state.walletDetails);
|
||||||
|
|
||||||
|
const uploadedImage = `${
|
||||||
|
userDetails.session_image_server
|
||||||
|
}${localStorage.getItem("session_token")}/job/${details?.job_uid}`;
|
||||||
|
|
||||||
|
const [taskImage, setTaskImage] = useState(uploadedImage);
|
||||||
|
|
||||||
|
let [uploadStatus, setUploadStatus] = useState({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
}); // HOLDS STATE FOR UPLOAD PROFILE PICTURE STATUS
|
||||||
|
|
||||||
|
let [requestStatus, setRequestStatus] = useState({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
}); // Holds state when submit button is pressed
|
||||||
|
|
||||||
|
let initialValues = {
|
||||||
|
// initial values for formik
|
||||||
|
country: details.currency,
|
||||||
|
price: details?.price * 0.01,
|
||||||
|
title: details?.title,
|
||||||
|
description: details?.description,
|
||||||
|
job_detail: details?.job_detail,
|
||||||
|
timeline_days: details?.timeline_days,
|
||||||
|
category: details?.category,
|
||||||
|
};
|
||||||
|
|
||||||
|
const jobApi = useMemo(() => new usersService(), []);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const handleEditJob = useCallback(
|
||||||
|
async (values) => {
|
||||||
|
let reqData = {
|
||||||
|
country: values?.country,
|
||||||
|
price: Number(values.price) * 100,
|
||||||
|
title: values?.title,
|
||||||
|
description: values?.description,
|
||||||
|
job_detail: values?.job_detail,
|
||||||
|
timeline_days: values?.timeline_days,
|
||||||
|
category: values.category?.join("@"),
|
||||||
|
job_id: details.job_id,
|
||||||
|
job_uid: details.job_uid,
|
||||||
|
};
|
||||||
|
setRequestStatus({ loading: true, message: "" });
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await jobApi.jobManagerUpdateJob(reqData);
|
||||||
|
let { data } = await res;
|
||||||
|
if (data?.internal_return < 0) return;
|
||||||
|
setRequestStatus({ loading: false, message: null });
|
||||||
|
setTimeout(() => {
|
||||||
|
dispatch(tableReload({ type: "JOBTABLE" }));
|
||||||
|
navigate("/myjobs", { replace: true });
|
||||||
|
onClose();
|
||||||
|
}, 1000);
|
||||||
|
} catch (error) {
|
||||||
|
setRequestStatus({ loading: false, message: error });
|
||||||
|
throw new Error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[jobApi, navigate, onClose, details]
|
||||||
|
);
|
||||||
|
|
||||||
|
const taskImgChangeHandler = (e) => {
|
||||||
|
setUploadStatus({ loading: false, status: false, message: "" });
|
||||||
|
let acceptedFormat = ["jpeg", "jpg", "png", "bmp", "gif"]; // ARRAY OF SUPPORTED FORMATS
|
||||||
|
let uploadedFile = e.target.files[0]; //UPLOADED FILE
|
||||||
|
|
||||||
|
const fileFormat = uploadedFile?.type?.split("/")[1]?.toLowerCase();
|
||||||
|
if (!acceptedFormat.includes(fileFormat)) {
|
||||||
|
//CHECKING FOR CORRECT UPLOAD FORMAT
|
||||||
|
const msg = `Please select ${acceptedFormat
|
||||||
|
.slice(0, -1)
|
||||||
|
.join(", ")} or ${acceptedFormat.slice(-1)}`;
|
||||||
|
setUploadStatus({ loading: false, status: false, message: msg });
|
||||||
|
return setTimeout(() => {
|
||||||
|
// profileImgInput.current.value = '' // clear the input
|
||||||
|
setUploadStatus({ loading: false, status: false, message: "" });
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uploadedFile.size > 5 * 1048576) {
|
||||||
|
// CHECKING FOR CORRECT FILE SIZE
|
||||||
|
setUploadStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "File must not exceed 5MB",
|
||||||
|
});
|
||||||
|
return setTimeout(() => {
|
||||||
|
// profileImgInput.current.value = '' // clear the input
|
||||||
|
setUploadStatus({ loading: false, status: false, message: "" });
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.target.value !== "") {
|
||||||
|
const imgReader = new FileReader();
|
||||||
|
imgReader.onload = (event) => {
|
||||||
|
let base64Img = imgReader.result.split(",")[1];
|
||||||
|
let reqData = {
|
||||||
|
// PAYLOAD FOR API CALL
|
||||||
|
job_uid: details?.job_uid,
|
||||||
|
file_name: uploadedFile?.name.slice(0, 19),
|
||||||
|
file_size: uploadedFile?.size,
|
||||||
|
file_type: uploadedFile?.type?.split("/")[0]?.toLowerCase(),
|
||||||
|
file_data: base64Img,
|
||||||
|
msg_type: "FILE",
|
||||||
|
action: apiConst.WRENCHBOARD_PICTURE_JOB,
|
||||||
|
};
|
||||||
|
setUploadStatus({
|
||||||
|
loading: true,
|
||||||
|
status: false,
|
||||||
|
message: "Loading...",
|
||||||
|
});
|
||||||
|
jobApi
|
||||||
|
.sendFiles(reqData)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.status != 200 || res.data.internal_return < 0) {
|
||||||
|
return setUploadStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "Something went wrong, try again",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setUploadStatus({
|
||||||
|
loading: false,
|
||||||
|
status: true,
|
||||||
|
message: "Uploaded successfully",
|
||||||
|
});
|
||||||
|
setTaskImage(event.target.result);
|
||||||
|
setTimeout(() => {
|
||||||
|
dispatch(tableReload({ type: "JOBTABLE" }));
|
||||||
|
navigate("/myjobs", { replace: true });
|
||||||
|
onClose();
|
||||||
|
}, 1000);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
setUploadStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "Network error, try again",
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
setUploadStatus({ loading: false, status: false, message: "" });
|
||||||
|
}, 5000);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
imgReader.readAsDataURL(e.target.files[0]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalCom action={onClose} situation={situation}>
|
||||||
|
<Formik
|
||||||
|
initialValues={initialValues}
|
||||||
|
validationSchema={validationSchema}
|
||||||
|
onSubmit={handleEditJob}
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<Form className="">
|
||||||
|
<div className="modal-container">
|
||||||
|
<div className="modal-header-con">
|
||||||
|
<h1 className="modal-title">
|
||||||
|
Edit Job
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="modal-close-btn"
|
||||||
|
onClick={onClose}
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
width="36"
|
||||||
|
height="36"
|
||||||
|
viewBox="0 0 36 36"
|
||||||
|
fill="none"
|
||||||
|
className="fill-current"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
||||||
|
fill=""
|
||||||
|
fillOpacity="0.6"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
||||||
|
fill="#"
|
||||||
|
fillOpacity="0.6"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="modal-body-wrapper">
|
||||||
|
<div className="flex flex-col-reverse sm:flex-row">
|
||||||
|
<div className="fields w-full">
|
||||||
|
<div className="sm:flex sm:space-x-7 mb-[0.5rem]">
|
||||||
|
<div className="field w-full mb-[0.5rem] sm:mb-0">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6 cursor-default"
|
||||||
|
label="Currency"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="country"
|
||||||
|
value={props.values.country}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
blurHandler={props.handleBlur}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Price */}
|
||||||
|
<div className="field w-full mb-[0.5rem] sm:mb-0">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6 text-right"
|
||||||
|
label="Price"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="number"
|
||||||
|
name="price"
|
||||||
|
value={props.values.price}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
blurHandler={props.handleBlur}
|
||||||
|
errorBorder={
|
||||||
|
props.errors.price && props.touched.price
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field w-full mb-[0.5rem] sm:mb-0">
|
||||||
|
<label
|
||||||
|
className="job-label"
|
||||||
|
htmlFor="timeline_days"
|
||||||
|
>
|
||||||
|
Timeline -
|
||||||
|
{/* <span className="w-full text-center text-green-700 text-sm tracking-wide">
|
||||||
|
Expected duration of this task
|
||||||
|
</span> */}
|
||||||
|
</label>
|
||||||
|
<Field
|
||||||
|
component="select"
|
||||||
|
name="timeline_days"
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border ${
|
||||||
|
props.errors.timeline_days &&
|
||||||
|
props.touched.timeline_days
|
||||||
|
? "border-[#ff0a0a63] shadow-red-500 border-[0.5px] animate-shake"
|
||||||
|
: "dark:border-[#5e6278]"
|
||||||
|
}`}
|
||||||
|
value={props.values.timeline_days}
|
||||||
|
>
|
||||||
|
<option value="" className='text-slate-500 text-lg'>Select Duration</option>
|
||||||
|
{publicArray.map(({ name, duration }, idx) => (
|
||||||
|
<option
|
||||||
|
key={duration}
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value={duration}
|
||||||
|
>
|
||||||
|
{name}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</Field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Title */}
|
||||||
|
<div className="field w-full mb-[0.5rem]">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Title"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass=" input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="title"
|
||||||
|
value={props.values.title}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
blurHandler={props.handleBlur}
|
||||||
|
errorBorder={props.errors.title && props.touched.title}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Description */}
|
||||||
|
<div className="field w-full mb-[0.5rem]">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Description"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass=" input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="description"
|
||||||
|
value={props.values.description}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
blurHandler={props.handleBlur}
|
||||||
|
errorBorder={
|
||||||
|
props.errors.description && props.touched.description
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Details */}
|
||||||
|
<div className="field flex flex-col sm:flex-row w-full mb-[2px] gap-2">
|
||||||
|
<div className="sm:w-[60%] w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="job-label"
|
||||||
|
className='job-label'
|
||||||
|
>
|
||||||
|
Job Delivery Details
|
||||||
|
</label>
|
||||||
|
<textarea
|
||||||
|
id="Job Delivery Details"
|
||||||
|
rows="5"
|
||||||
|
className={`input-field px-6 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] ${
|
||||||
|
props.errors.job_detail && props.touched.job_detail
|
||||||
|
? "border-[#ff0a0a63] shadow-red-500 border-[0.5px] animate-shake"
|
||||||
|
: "border border-[#f5f8fa] dark:border-[#5e6278]"
|
||||||
|
} rounded-[10px]`}
|
||||||
|
style={{ resize: "none" }}
|
||||||
|
name="job_detail"
|
||||||
|
value={props.values.job_detail}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
onBlur={props.handleBlur}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="sm:w-[35%] w-full">
|
||||||
|
<div
|
||||||
|
htmlFor="Job Categories"
|
||||||
|
className='job-label'
|
||||||
|
id="checked-group"
|
||||||
|
>
|
||||||
|
Categories
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="sm:flex-col flex flex-wrap px-3 mt-3"
|
||||||
|
role="group"
|
||||||
|
aria-labelledby="checked-group"
|
||||||
|
>
|
||||||
|
{categories &&
|
||||||
|
Object.entries(categories)?.map(([key, value]) => (
|
||||||
|
<label
|
||||||
|
key={key}
|
||||||
|
className="flex gap-1 w-full items-center dark:text-white"
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
type="checkbox"
|
||||||
|
name="category"
|
||||||
|
value={key}
|
||||||
|
/>
|
||||||
|
<span className="text-[13.975px]">{value}</span>
|
||||||
|
</label>
|
||||||
|
))}
|
||||||
|
<span className="h-5 text-sm italic text-[#cf3917]">
|
||||||
|
{props.errors.category &&
|
||||||
|
props.touched.category &&
|
||||||
|
"please select a category"}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="w-full flex items-center justify-center gap-2 mb-2">
|
||||||
|
{/* FOR TASK IMAGE */}
|
||||||
|
<div className="w-1/3 relative flex flex-col max-h-[130px] min-h-[130px]">
|
||||||
|
<div className="w-full flex gap-2">
|
||||||
|
<label
|
||||||
|
className={`w-full job-label cursor-pointer ${uploadStatus.loading && 'pointer-events-none'}`}
|
||||||
|
htmlFor="task_image"
|
||||||
|
>
|
||||||
|
Banner
|
||||||
|
</label>
|
||||||
|
{uploadStatus.loading ?
|
||||||
|
<LoadingSpinner size='6' />
|
||||||
|
:
|
||||||
|
<span className={`text-[10px] ${uploadStatus.status ? 'text-emerald-600' : 'text-red-500'}`}>{uploadStatus.message}</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
id="task_image"
|
||||||
|
className="hidden"
|
||||||
|
type="file"
|
||||||
|
accept="image/*"
|
||||||
|
onChange={taskImgChangeHandler}
|
||||||
|
/>
|
||||||
|
{taskImage ? (
|
||||||
|
<div className="w-full relative h-full">
|
||||||
|
<img
|
||||||
|
src={taskImage}
|
||||||
|
className="h-32 w-full object-cover"
|
||||||
|
alt="uploaded task"
|
||||||
|
/>
|
||||||
|
<div className="absolute inset-0 flex flex-col justify-center items-center">
|
||||||
|
<span
|
||||||
|
onClick={() => setTaskImage("")}
|
||||||
|
className="p-2 bg-white/80 hover:bg-white hover:shadow-md transition-all duration-500 cursor-pointer text-slate-800"
|
||||||
|
>
|
||||||
|
Remove Image
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="absolute inset-0 flex flex-col justify-center items-center">
|
||||||
|
<label
|
||||||
|
className="p-2 bg-slate-100 dark:bg-[#11131F] cursor-pointer input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold"
|
||||||
|
htmlFor="task_image"
|
||||||
|
>
|
||||||
|
Select Task Image
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{/* END OF TASK IMAGE */}
|
||||||
|
|
||||||
|
<div className="field w-2/3">
|
||||||
|
<AttachFile data={details} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{/* inputs ends here */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||||
|
<div className="content-footer w-full">
|
||||||
|
{/* error or success display */}
|
||||||
|
{requestStatus.message != "" &&
|
||||||
|
(!requestStatus.status ? (
|
||||||
|
<div
|
||||||
|
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
|
>
|
||||||
|
{requestStatus.message}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
requestStatus.status && (
|
||||||
|
<div
|
||||||
|
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
|
>
|
||||||
|
{requestStatus.message}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
{/* End of error or success display */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="modal-footer-wrapper justify-end">
|
||||||
|
{requestStatus.loading ? (
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="custom-btn btn-gradient text-white"
|
||||||
|
disabled={
|
||||||
|
requestStatus.loading || uploadStatus.loading
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
)}
|
||||||
|
</Formik>
|
||||||
|
</ModalCom>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default EditJobPopoutNew;
|
||||||
|
|
||||||
|
const publicArray = [
|
||||||
|
{ duration: 1, name: "1 day" },
|
||||||
|
{ duration: 2, name: "2 days" },
|
||||||
|
{ duration: 3, name: "3 days" },
|
||||||
|
{ duration: 4, name: "4 days" },
|
||||||
|
{ duration: 5, name: "5 days" },
|
||||||
|
{ duration: 6, name: "6 days" },
|
||||||
|
{ duration: 7, name: "1 week" },
|
||||||
|
{ duration: 14, name: "2 weeks" },
|
||||||
|
{ duration: 21, name: "3 weeks" },
|
||||||
|
{ duration: 28, name: "4 weeks" },
|
||||||
|
];
|
||||||
@@ -11,6 +11,7 @@ import { tableReload } from "../../store/TableReloads";
|
|||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
|
|
||||||
import { SocketValues } from "../Contexts/SocketIOContext";
|
import { SocketValues } from "../Contexts/SocketIOContext";
|
||||||
|
import AttachFile from "../attachmentCom/AttachFile";
|
||||||
|
|
||||||
const VideoElement = lazy(() => import("../VideoCom/VideoElement"));
|
const VideoElement = lazy(() => import("../VideoCom/VideoElement"));
|
||||||
const ImageElement = lazy(() => import("../ImageCon/ImageElement"));
|
const ImageElement = lazy(() => import("../ImageCon/ImageElement"));
|
||||||
@@ -206,11 +207,11 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* ACTION SECTION */}
|
{/* ACTION SECTION */}
|
||||||
<div className="p-4 w-full md:w-2/5 h-full flex flex-col justify-between">
|
<div className="p-4 w-full md:w-2/5 h-full flex flex-col gap-4 justify-between">
|
||||||
{ details.job_type == 'TASK' ?
|
{ details.job_type == 'TASK' ?
|
||||||
<div className="image-wrapper w-full h-40 flex justify-center items-center">
|
<div className="image-wrapper w-full h-40 flex justify-center items-center">
|
||||||
<Suspense fallback={<p className="w-full text-center">Loading...</p>}>
|
<Suspense fallback={<p className="w-full text-center">Loading...</p>}>
|
||||||
<ImageElement src={details?.image} alt='banner' className='w-auto h-full' />
|
<ImageElement src={details?.image} alt='banner' className='w-full h-auto' />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
@@ -222,6 +223,9 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
<div className="w-full">
|
||||||
|
<AttachFile data={details} showOnData={true} />
|
||||||
|
</div>
|
||||||
<div className="my-3 md:flex md:justify-center">
|
<div className="my-3 md:flex md:justify-center">
|
||||||
{requestStatus.loading && requestStatus.trigger == "offer" ? (
|
{requestStatus.loading && requestStatus.trigger == "offer" ? (
|
||||||
<LoadingSpinner size={8} color="sky-blue" />
|
<LoadingSpinner size={8} color="sky-blue" />
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ const JobFieldInput = ({
|
|||||||
<Field
|
<Field
|
||||||
component="select"
|
component="select"
|
||||||
name={inputName}
|
name={inputName}
|
||||||
className={`input-field placeholder:text-base text-dark-gray w-full h-full bg-white outline-none px-2`}
|
className={`options-default`}
|
||||||
value={value}
|
value={value}
|
||||||
>
|
>
|
||||||
{/* <option value="">{optionText}</option> */}
|
{/* <option value="">{optionText}</option> */}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react'
|
|||||||
function Detail({label, value, bg,}) {
|
function Detail({label, value, bg,}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<label className='job-label w-full md:w-1/4'>{label}</label>
|
<label className='job-label w-full md:w-[150px]'>{label}</label>
|
||||||
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white ${bg ? bg : null}`}>{value}</p>
|
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white ${bg ? bg : null}`}>{value}</p>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
+18
-6
@@ -160,8 +160,12 @@
|
|||||||
@apply flex items-center gap-2
|
@apply flex items-center gap-2
|
||||||
}
|
}
|
||||||
|
|
||||||
/* STYLES FOR MODAL */
|
/* STYLES FOR MODAL 'NOTE => VIEW JOB EDIT MODAL/ADD JOB MODAL FOR SAMPLE USAGE'*/
|
||||||
/* Modal Header */
|
.modal-container {
|
||||||
|
@apply w-11/12 md:w-[700px] mx-auto h-auto max-h-full flex flex-col bg-white dark:bg-dark-white lg:rounded-2xl overflow-hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Modal Header section*/
|
||||||
.modal-header-con{
|
.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
|
@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
|
||||||
}
|
}
|
||||||
@@ -172,9 +176,14 @@
|
|||||||
@apply text-[#000] dark:text-red-500
|
@apply text-[#000] dark:text-red-500
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Modal Body section */
|
||||||
|
.modal-body-wrapper {
|
||||||
|
@apply w-full min-h-[300px] h-full overflow-y-auto flex flex-col items-center px-10 p-2
|
||||||
|
}
|
||||||
|
|
||||||
/* modal footer */
|
/* modal footer */
|
||||||
.modal-footer-wrapper{
|
.modal-footer-wrapper{
|
||||||
@apply p-4 border-t-2 flex justify-between items-center
|
@apply p-4 border-t-2 flex justify-between items-center w-full
|
||||||
}
|
}
|
||||||
/* END OF STYLES FOR MODAL BOX */
|
/* END OF STYLES FOR MODAL BOX */
|
||||||
|
|
||||||
@@ -183,7 +192,10 @@
|
|||||||
@apply px-2 min-w-[80px] h-11 flex justify-center items-center text-base rounded-full cursor-pointer
|
@apply px-2 min-w-[80px] h-11 flex justify-center items-center text-base rounded-full cursor-pointer
|
||||||
}
|
}
|
||||||
.logout-btn {
|
.logout-btn {
|
||||||
@apply px-4 min-w-[80px] h-[52px] flex justify-center items-center text-base rounded-full cursor-pointer
|
@apply px-4 min-w-[80px] h-[52px] flex justify-center items-center text-xl font-bold rounded-full cursor-pointer
|
||||||
|
}
|
||||||
|
.options-default {
|
||||||
|
@apply px-2 placeholder:text-sm w-full h-full bg-white outline-none text-sm text-slate-900 dark:text-white
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1103,6 +1115,6 @@ TODO: Responsive ===========================
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.assign-task-popup {
|
/* .assign-task-popup {
|
||||||
top: 75px;
|
top: 75px;
|
||||||
}
|
} */
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export const apiConst = {
|
|||||||
WRENCH_FILE_FAMILY: 400,
|
WRENCH_FILE_FAMILY: 400,
|
||||||
WRENCH_FILE_FAMILYBANNER: 410,
|
WRENCH_FILE_FAMILYBANNER: 410,
|
||||||
WRENCH_FILE_JOB : 500,
|
WRENCH_FILE_JOB : 500,
|
||||||
|
JOB_MANAGER_FILES: 13012,
|
||||||
WRENCHBOARD_BKO_START: 10000,
|
WRENCHBOARD_BKO_START: 10000,
|
||||||
WRENCHBOARD_BKO_LOGIN: 10010,
|
WRENCHBOARD_BKO_LOGIN: 10010,
|
||||||
WRENCHBOARD_BKO_CREATEUSER: 10015,
|
WRENCHBOARD_BKO_CREATEUSER: 10015,
|
||||||
|
|||||||
@@ -908,6 +908,60 @@ class usersService {
|
|||||||
return this.postAuxEnd("/uploads", postData);
|
return this.postAuxEnd("/uploads", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION FOR NEW FILE UPLOAD
|
||||||
|
sendFilesNew(reqData) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: apiConst.WRENCHBOARD_CONTRACT_MESSAGE,
|
||||||
|
...reqData,
|
||||||
|
};
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
for (let data in postData) {
|
||||||
|
formData.append(data, postData[data]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.postAuxEnd("/upload/contract", formData, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO UPLOAD RESOURCE FILES
|
||||||
|
uploadFile(reqData) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: apiConst.WRENCHBOARD_CONTRACT_MESSAGE,
|
||||||
|
...reqData,
|
||||||
|
};
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
for (let data in postData) {
|
||||||
|
formData.append(data, postData[data]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.postAuxEnd("/upload/resources", formData, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO UPLOAD TASK FILES
|
||||||
|
uploadTaskFile(reqData) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
// action: apiConst.WRENCHBOARD_CONTRACT_MESSAGE,
|
||||||
|
...reqData,
|
||||||
|
};
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
for (let data in postData) {
|
||||||
|
formData.append(data, postData[data]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.postAuxEnd("/upload/task", formData, true);
|
||||||
|
}
|
||||||
|
|
||||||
// END POINT TO DELETE A JOB
|
// END POINT TO DELETE A JOB
|
||||||
deleteJob(reqData) {
|
deleteJob(reqData) {
|
||||||
var postData = {
|
var postData = {
|
||||||
@@ -1356,6 +1410,18 @@ class usersService {
|
|||||||
return this.postAuxEnd("/assignmediatask", postData);
|
return this.postAuxEnd("/assignmediatask", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// API FUNCTION FOR LISTING JOB MANAGER FILES (TASK FILE UPLAOD)
|
||||||
|
jobManagerFiles(reqData) {
|
||||||
|
var postData = {
|
||||||
|
member_uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: apiConst.JOB_MANAGER_FILES,
|
||||||
|
...reqData
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/jobmanagerfiles", postData);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
||||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||||
@@ -1444,8 +1510,8 @@ class usersService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
postAuxEnd(uri, reqData) {
|
postAuxEnd(uri, reqData, uploadPost=false) {
|
||||||
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
const endPoint = uploadPost ? process.env.REACT_APP_MEDIA_LINK + uri : process.env.REACT_APP_USERS_ENDPOINT + uri;
|
||||||
const session_token = localStorage.getItem("session_token");
|
const session_token = localStorage.getItem("session_token");
|
||||||
// session_token = session_token !=null ?session_token : '';
|
// session_token = session_token !=null ?session_token : '';
|
||||||
// 'Authorization': `Basic ${(session_token !=null) ?session_token : ''}`,
|
// 'Authorization': `Basic ${(session_token !=null) ?session_token : ''}`,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import ModalCom from "../components/Helpers/ModalCom";
|
|||||||
function AddJobPage({ action, situation, categories }) {
|
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="modal-container">
|
||||||
<div className="modal-header-con">
|
<div className="modal-header-con">
|
||||||
<h1 className="modal-title">
|
<h1 className="modal-title">
|
||||||
New Job
|
New Job
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
|
import {useEffect} from 'react'
|
||||||
import WalletRoutes from "../components/MyWallet/Wallet";
|
import WalletRoutes from "../components/MyWallet/Wallet";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import {useNavigate} from 'react-router-dom'
|
||||||
|
|
||||||
export default function MyWalletPage() {
|
export default function MyWalletPage() {
|
||||||
|
const {userDetails: { account_type, wallet_available_status }} = useSelector((state) => state?.userDetails);
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
let walletExist = wallet_available_status || localStorage.getItem('wallet_available_status')
|
||||||
|
console.log(walletExist)
|
||||||
|
if(account_type == 'FULL' && walletExist != 'WALLET_AVAILABLE'){
|
||||||
|
navigate('/', {replace: true})
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return <WalletRoutes />;
|
return <WalletRoutes />;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user