Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 29cec58122 | |||
| d258158a13 | |||
| 1c47fa283a | |||
| d1b07e6e66 | |||
| 648f228e45 | |||
| 551a302ede | |||
| 108c82b2f8 | |||
| f46713ef00 | |||
| 992993b710 | |||
| 617df4200e | |||
| a47e398e87 | |||
| 281c4c7ab7 |
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 245 KiB |
@@ -1,20 +1,28 @@
|
|||||||
import React, { lazy } from "react";
|
import React, { lazy, useContext } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { localImgLoad } from "../../lib";
|
import { localImgLoad } from "../../lib";
|
||||||
|
|
||||||
|
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||||
|
|
||||||
export default function LoginLayout({ slogan, children }) {
|
export default function LoginLayout({ slogan, children }) {
|
||||||
const bgImg = localImgLoad('images/left-wrenchboard.jpg')
|
const bgImg = localImgLoad('images/left-wrenchboard.jpg')
|
||||||
|
const bgImgNig = localImgLoad('images/wrench-home-back-nigeria.jpg')
|
||||||
|
const bgImgCom = localImgLoad('images/wrench-home-back-common.jpg')
|
||||||
|
|
||||||
|
const {countryMode} = useContext(DarkModeContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`layout-wrapper login`}>
|
<div className={`h-screen overflow-y-auto bg-cover bg-center`}
|
||||||
<div className={`w-full min-h-screen overflow-y-auto lg:grid grid-cols-2`}>
|
style={{backgroundImage: `url(${ countryMode == 'NG' ? bgImgNig : bgImgCom})`}}
|
||||||
<div
|
>
|
||||||
|
<div className={`w-full grid grid-cols-1 lg:grid-cols-2`}>
|
||||||
|
{/* <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 lg: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">
|
<div className="p-5 sm:p-7 flex place-content-center lg:col-start-2">
|
||||||
<div className="py-10 w-11/12 h-full flex flex-col justify-between items-center content-wrapper login shadow-md xl:bg-white dark:bg-dark-white rounded-[0.475rem]">
|
<div className="py-10 w-full sm:w-11/12 max-w-2xl 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>
|
||||||
@@ -48,7 +56,7 @@ export default function LoginLayout({ slogan, children }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p className="py-1 text-black text-[15px] px-2 font-medium flex items-center gap-1">
|
<p className="py-1 text-black text-[15px] px-2 font-medium flex items-center gap-1">
|
||||||
<span className="">© {new Date().getFullYear()} -</span>
|
<span className="dark:text-white">© {new Date().getFullYear()} -</span>
|
||||||
<Link to="/" className="text-[#009ef7] ml-1">
|
<Link to="/" className="text-[#009ef7] ml-1">
|
||||||
WrenchBoard
|
WrenchBoard
|
||||||
</Link>{" "}
|
</Link>{" "}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export default function ForgotPassword() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-11/12 sm:max-w-[400px]">
|
<div className="w-10/12">
|
||||||
{msgSuccess == null ?
|
{msgSuccess == null ?
|
||||||
<>
|
<>
|
||||||
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ export default function Login() {
|
|||||||
</div>
|
</div>
|
||||||
{/* <div className="content-wrapper login shadow-md w-10/12 mx-auto flex justify-center items-center xl:bg-white dark:bg-dark-white 2xl:w-[828px] rounded-[0.475rem] sm:p-7 p-5"> */}
|
{/* <div className="content-wrapper login shadow-md w-10/12 mx-auto flex justify-center items-center xl:bg-white dark:bg-dark-white 2xl:w-[828px] rounded-[0.475rem] sm:p-7 p-5"> */}
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-11/12 sm:max-w-[530px]">
|
<div className="w-10/12">
|
||||||
{/* HIDES THIS IF USER SESSION HAS EXPIRED */}
|
{/* HIDES THIS IF USER SESSION HAS EXPIRED */}
|
||||||
{sessionExpired != "true" && (
|
{sessionExpired != "true" && (
|
||||||
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ export default function SignUp() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-11/12 sm:max-w-[530px]">
|
<div className="w-10/12">
|
||||||
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
||||||
<h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
<h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
||||||
Create Account
|
Create Account
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default function UpdatePassword() {
|
|||||||
<AuthLayout slogan="Welcome to myFit">
|
<AuthLayout slogan="Welcome to myFit">
|
||||||
{updated === false ? (
|
{updated === false ? (
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-11/12 sm:max-w-[600px]">
|
<div className="w-10/12">
|
||||||
<div className="title-area relative flex flex-col justify-center items-center mb-7">
|
<div className="title-area relative flex flex-col justify-center items-center mb-7">
|
||||||
<h1 className="sm:text-5xl text-4xl font-bold leading-[74px] text-dark-gray dark:text-white">
|
<h1 className="sm:text-5xl text-4xl font-bold leading-[74px] text-dark-gray dark:text-white">
|
||||||
Update Password
|
Update Password
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export default function VerifyLink() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-11/12 sm:max-w-[500px]">
|
<div className="w-10/12">
|
||||||
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
||||||
<h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
<h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
||||||
{linkSuccess
|
{linkSuccess
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ const VerifyPassword = () => {
|
|||||||
{requestStatus.loading ? (
|
{requestStatus.loading ? (
|
||||||
<LoadingSpinner color="sky-blue" size="16" height="h-300px" />
|
<LoadingSpinner color="sky-blue" size="16" height="h-300px" />
|
||||||
) : !requestStatus.loading && requestStatus.status ? (
|
) : !requestStatus.loading && requestStatus.status ? (
|
||||||
<div className="w-11/12 sm:max-w-[500px]">
|
<div className="w-10/12">
|
||||||
{linkSuccess == null ? (
|
{linkSuccess == null ? (
|
||||||
<>
|
<>
|
||||||
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default function VerifyYou() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-11/12 sm:max-w-[500px]">
|
<div className="w-10/12">
|
||||||
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
||||||
<h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
<h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
||||||
Let's verify your email now
|
Let's verify your email now
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ const validationSchema = Yup.object().shape({
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default function InviteRelative({action, situation, setReloadRelList}) {
|
export default function InviteRelative({action, situation, setReloadRelList, relativeList}) {
|
||||||
|
|
||||||
const api = new usersService()
|
const api = new usersService()
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ export default function InviteRelative({action, situation, setReloadRelList}) {
|
|||||||
|
|
||||||
{/* Type */}
|
{/* Type */}
|
||||||
<div className="md:flex md:space-x-7 items-end mb-6">
|
<div className="md:flex md:space-x-7 items-end mb-6">
|
||||||
<div className="field w-full mb-6 md:mb-0">
|
{/* <div className="field w-full mb-6 md:mb-0">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
label="Type"
|
label="Type"
|
||||||
@@ -179,6 +179,52 @@ export default function InviteRelative({action, situation, setReloadRelList}) {
|
|||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
error={(props.errors.family_type && props.touched.family_type) ? props.errors.family_type : '' }
|
error={(props.errors.family_type && props.touched.family_type) ? props.errors.family_type : '' }
|
||||||
/>
|
/>
|
||||||
|
</div> */}
|
||||||
|
<div className="field w-full mb-6 xl:mb-0">
|
||||||
|
<label
|
||||||
|
htmlFor="family_type"
|
||||||
|
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex item-center gap-1"
|
||||||
|
>
|
||||||
|
Family Type
|
||||||
|
{props.errors.family_type && props.touched.family_type && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.family_type}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="family_type"
|
||||||
|
name="family_type"
|
||||||
|
value={props.values.family_type}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full 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`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
onBlur={props.handleBlur}
|
||||||
|
>
|
||||||
|
{relativeList?.loading ? (
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Loading...
|
||||||
|
</option>
|
||||||
|
) : relativeList?.family_types?.length ? (
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Select Family Type
|
||||||
|
</option>
|
||||||
|
{relativeList?.family_types?.map((item, index) => (
|
||||||
|
<option
|
||||||
|
key={index}
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value={item?.ty}
|
||||||
|
>
|
||||||
|
{item?.ty}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
No Options Found! Try Again
|
||||||
|
</option>
|
||||||
|
)}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className="field w-full flex justify-end">
|
<div className="field w-full flex justify-end">
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const Relatives = () => {
|
|||||||
|
|
||||||
const [invitePopout, setInvitePopout] = useState(false)
|
const [invitePopout, setInvitePopout] = useState(false)
|
||||||
|
|
||||||
const [relativeList, setRelativeList] = useState({loading: true, data:[]})
|
const [relativeList, setRelativeList] = useState({loading: true, result_list:[], family_types:[]})
|
||||||
|
|
||||||
const showInviteMemberPopout = () => {
|
const showInviteMemberPopout = () => {
|
||||||
setInvitePopout(true)
|
setInvitePopout(true)
|
||||||
@@ -21,14 +21,14 @@ const Relatives = () => {
|
|||||||
const getRelativeList = () => {
|
const getRelativeList = () => {
|
||||||
setRelativeList(prev => ({...prev, loading: true}))
|
setRelativeList(prev => ({...prev, loading: true}))
|
||||||
api.getFamilyRelativeList().then(response => {
|
api.getFamilyRelativeList().then(response => {
|
||||||
let {data:{result_list}} = response
|
let {status, data} = response
|
||||||
if(!result_list || result_list?.length <= 0){
|
if(status != 200 || !data){
|
||||||
setRelativeList({loading:false, data:[]})
|
setRelativeList({loading:false, result_list:[], family_types:[]})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
setRelativeList({loading:false, data:result_list})
|
setRelativeList({loading:false, result_list:data?.result_list, family_types:data?.family_types})
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
setRelativeList({loading:false, data:[]})
|
setRelativeList({loading:false, result_list:[], family_types:[]})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ const Relatives = () => {
|
|||||||
{relativeList.loading ?
|
{relativeList.loading ?
|
||||||
<LoadingSpinner size='8' height='h-full' />
|
<LoadingSpinner size='8' height='h-full' />
|
||||||
:
|
:
|
||||||
<RelativeTable relativeList={relativeList.data} />
|
<RelativeTable relativeList={relativeList.result_list} />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -58,6 +58,7 @@ const Relatives = () => {
|
|||||||
action={()=>setInvitePopout(false)}
|
action={()=>setInvitePopout(false)}
|
||||||
situation={invitePopout}
|
situation={invitePopout}
|
||||||
setReloadRelList={setReloadRelList}
|
setReloadRelList={setReloadRelList}
|
||||||
|
relativeList={relativeList}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
{/* END OF INVITE RELATIVE POPOUT */}
|
{/* END OF INVITE RELATIVE POPOUT */}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default function GroupList({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="p-5 w-full lg:w-[400px] min-h-[300px] bg-sky-100 dark:bg-dark-gray rounded-2xl">
|
<div className="p-5 w-full lg:w-[400px] min-h-[300px] bg-sky-100 dark:bg-dark-gray rounded-2xl flex flex-col">
|
||||||
{/* <h1 className='mb-5 text-lg lg:text-2xl tracking-wide font-bold text-slate-900 dark:text-slate-100'>Jobs Groups</h1> */}
|
{/* <h1 className='mb-5 text-lg lg:text-2xl tracking-wide font-bold text-slate-900 dark:text-slate-100'>Jobs Groups</h1> */}
|
||||||
<div className="flex justify-end items-center">
|
<div className="flex justify-end items-center">
|
||||||
<button
|
<button
|
||||||
@@ -46,7 +46,7 @@ export default function GroupList({
|
|||||||
No Group Found!
|
No Group Found!
|
||||||
</h1>
|
</h1>
|
||||||
) : (
|
) : (
|
||||||
<div className="my-4 max-h-[400px] overflow-y-auto">
|
<div className="my-4 max-h-[596px] bg-[#fffef6] rounded overflow-y-auto flex-1">
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
{groupList.map((item) => (
|
{groupList.map((item) => (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default function GroupMemberTable({ selectedList }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`w-full p-8 bg-white dark:bg-dark-gray overflow-hidden rounded-2xl section-shadow`}
|
className={`w-full p-8 dark:bg-dark-gray overflow-hidden rounded-2xl section-shado bg-[#fffef6]`}
|
||||||
>
|
>
|
||||||
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between min-h-[400px]">
|
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between min-h-[400px]">
|
||||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||||
@@ -79,8 +79,8 @@ export default function GroupMemberTable({ selectedList }) {
|
|||||||
</tr>
|
</tr>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
<tr className="font-semibold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||||
<td className="p-2">No Members Found</td>
|
<td className="p-2">No Members Found. Please add</td>
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export default function JobGroups() {
|
|||||||
<Layout>
|
<Layout>
|
||||||
<div>
|
<div>
|
||||||
<h1 className="mb-5 text-lg lg:text-2xl tracking-wide font-bold text-slate-900 dark:text-slate-100">
|
<h1 className="mb-5 text-lg lg:text-2xl tracking-wide font-bold text-slate-900 dark:text-slate-100">
|
||||||
Jobs Groups
|
Job Groups
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-5 w-full min-h-[400px] flex flex-col lg:flex-row gap-3 lg:gap-6 rounded-lg shadow-md bg-white dark:bg-dark-white">
|
<div className="p-5 w-full min-h-[400px] flex flex-col lg:flex-row gap-3 lg:gap-6 rounded-lg shadow-md bg-white dark:bg-dark-white">
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ export default function MemberList({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="my-2 flex flex-col min-h-[300px]">
|
<div className="my-2 flex flex-col min-h-[300px] h-full">
|
||||||
{selectedGroup?.data?.length < 1 ? (
|
{selectedGroup?.data?.length < 1 ? (
|
||||||
<h1 className="my-5 text-lg lg:text-xl tracking-wide text-slate-900 dark:text-slate-100">
|
<h1 className="my-5 text-lg lg:text-xl tracking-wide text-slate-900 dark:text-slate-100">
|
||||||
No Member Found, Please Add
|
No Member Found, Please Add
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import dataImage2 from "../../assets/images/data-table-user-2.png";
|
|
||||||
import SelectBox from "../Helpers/SelectBox";
|
|
||||||
import DeleteJobPopout from "../jobPopout/DeleteJobPopout";
|
|
||||||
import JobListPopout from "../jobPopout/JobListPopout";
|
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
|
import SelectBox from "../Helpers/SelectBox";
|
||||||
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||||
import PaginatedList from "../Pagination/PaginatedList";
|
import PaginatedList from "../Pagination/PaginatedList";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
import DeleteJobPopout from "../jobPopout/DeleteJobPopout";
|
||||||
import EditJobPopOut from "../jobPopout/EditJobPopout";
|
import EditJobPopOut from "../jobPopout/EditJobPopout";
|
||||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
|
||||||
|
|
||||||
import EditIcon from "../../assets/images/icon-edit.svg";
|
|
||||||
import DeleteIcon from "../../assets/images/icon-delete.svg";
|
import DeleteIcon from "../../assets/images/icon-delete.svg";
|
||||||
import localImgLoad from "../../lib/localImgLoad";
|
import EditIcon from "../../assets/images/icon-edit.svg";
|
||||||
|
import JobListPopout from "../jobPopout/JobListPopout";
|
||||||
|
|
||||||
export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
||||||
// Getting the categories
|
// Getting the categories
|
||||||
@@ -42,7 +40,6 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
|
|
||||||
// Get Country Api
|
// Get Country Api
|
||||||
const getCountryList = useCallback(async () => {
|
const getCountryList = useCallback(async () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await userApi.getSignupCountryData();
|
const res = await userApi.getSignupCountryData();
|
||||||
if (res.status === 200 && res.data.internal_return >= 0) {
|
if (res.status === 200 && res.data.internal_return >= 0) {
|
||||||
@@ -59,7 +56,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
}, [userApi, country]);
|
}, [userApi, country]);
|
||||||
console.log('MY COUNTRY', myCountry)
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getCountryList();
|
getCountryList();
|
||||||
}, [getCountryList]);
|
}, [getCountryList]);
|
||||||
@@ -201,6 +198,55 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const MyJobListTable = () => (
|
||||||
|
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between min-h-[520px]">
|
||||||
|
<table className="table-auto min-w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||||
|
<tbody>
|
||||||
|
<>
|
||||||
|
{MyJobList &&
|
||||||
|
MyJobList?.data?.result_list &&
|
||||||
|
MyJobList.data?.result_list.length > 0 ? (
|
||||||
|
filteredCurrentJobList?.length ? (
|
||||||
|
filteredCurrentJobList.map((value, index) => (
|
||||||
|
<JobListItem
|
||||||
|
index={index}
|
||||||
|
key={index}
|
||||||
|
value={value}
|
||||||
|
image_server={MyJobList?.data.session_image_server}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||||
|
<td className="p-2">No Jobs Available In This Category!</td>
|
||||||
|
</tr>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||||
|
<td className="p-2">No Jobs Available!</td>
|
||||||
|
</tr>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{/* PAGINATION BUTTON */}
|
||||||
|
<PaginatedList
|
||||||
|
onClick={handlePagination}
|
||||||
|
prev={currentPage == 0 ? true : false}
|
||||||
|
next={
|
||||||
|
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
|
||||||
|
currentJobList?.length
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
|
data={currentJobList}
|
||||||
|
start={indexOfFirstItem}
|
||||||
|
stop={indexOfLastItem}
|
||||||
|
/>
|
||||||
|
{/* END OF PAGINATION BUTTON */}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
|
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
|
||||||
@@ -223,54 +269,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
{MyJobList?.loading ? (
|
{MyJobList?.loading ? (
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
<LoadingSpinner size="16" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between min-h-[520px]">
|
<MyJobListTable />
|
||||||
<table className="table-auto min-w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
|
||||||
<tbody>
|
|
||||||
<>
|
|
||||||
{MyJobList &&
|
|
||||||
MyJobList?.data?.result_list &&
|
|
||||||
MyJobList.data?.result_list.length > 0 ? (
|
|
||||||
filteredCurrentJobList?.length ? (
|
|
||||||
filteredCurrentJobList.map((value, index) => (
|
|
||||||
<JobListItem
|
|
||||||
index={index}
|
|
||||||
key={index}
|
|
||||||
value={value}
|
|
||||||
image_server={MyJobList?.data.session_image_server}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
) : (
|
|
||||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
|
||||||
<td className="p-2">
|
|
||||||
No Jobs Available In This Category!
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
)
|
|
||||||
) : (
|
|
||||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
|
||||||
<td className="p-2">No Jobs Avaliable!</td>
|
|
||||||
</tr>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
|
||||||
<PaginatedList
|
|
||||||
onClick={handlePagination}
|
|
||||||
prev={currentPage == 0 ? true : false}
|
|
||||||
next={
|
|
||||||
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
|
|
||||||
currentJobList?.length
|
|
||||||
? true
|
|
||||||
: false
|
|
||||||
}
|
|
||||||
data={currentJobList}
|
|
||||||
start={indexOfFirstItem}
|
|
||||||
stop={indexOfLastItem}
|
|
||||||
/>
|
|
||||||
{/* END OF PAGINATION BUTTON */}
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Job List Popout */}
|
{/* Job List Popout */}
|
||||||
|
|||||||
@@ -5,6 +5,13 @@ function Default({ children }) {
|
|||||||
// dark mode setup
|
// dark mode setup
|
||||||
const [theme, setTheme] = useState(null);
|
const [theme, setTheme] = useState(null);
|
||||||
|
|
||||||
|
// country mode setup
|
||||||
|
const [countryMode, setCountryMode] = useState(localStorage.getItem('cnt') ? localStorage.getItem('cnt')?.toUpperCase() : '')
|
||||||
|
|
||||||
|
|
||||||
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
|
const country = queryParams.get("cnt")?.toUpperCase();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
||||||
setTheme("dark");
|
setTheme("dark");
|
||||||
@@ -24,9 +31,17 @@ function Default({ children }) {
|
|||||||
const handleThemeSwitch = () => {
|
const handleThemeSwitch = () => {
|
||||||
setTheme(theme === "dark" ? "light" : "dark");
|
setTheme(theme === "dark" ? "light" : "dark");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(country){
|
||||||
|
setCountryMode(country)
|
||||||
|
localStorage.setItem('cnt', country)
|
||||||
|
}
|
||||||
|
},[countryMode])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DarkModeContext.Provider value={{ theme, handleThemeSwitch }}>
|
<DarkModeContext.Provider value={{ theme, handleThemeSwitch, countryMode }}>
|
||||||
{children && children}
|
{children && children}
|
||||||
</DarkModeContext.Provider>
|
</DarkModeContext.Provider>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default function Layout({ children }) {
|
|||||||
localStorage.removeItem("member_id");
|
localStorage.removeItem("member_id");
|
||||||
localStorage.removeItem("uid");
|
localStorage.removeItem("uid");
|
||||||
sessionStorage.removeItem("family_uid");
|
sessionStorage.removeItem("family_uid");
|
||||||
// localStorage.clear();
|
localStorage.clear();
|
||||||
// toast.success("Come Back Soon", {
|
// toast.success("Come Back Soon", {
|
||||||
// icon: `🙂`,
|
// icon: `🙂`,
|
||||||
// });
|
// });
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { Field, Form, Formik } from "formik";
|
import { Field, Form, Formik } from "formik";
|
||||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import { tableReload } from "../../store/TableReloads";
|
import { tableReload } from "../../store/TableReloads";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom/index";
|
import InputCom from "../Helpers/Inputs/InputCom/index";
|
||||||
import ModalCom from "../Helpers/ModalCom";
|
import ModalCom from "../Helpers/ModalCom";
|
||||||
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import Detail from "./popoutcomponent/Detail";
|
import Detail from "./popoutcomponent/Detail";
|
||||||
|
|
||||||
@@ -45,6 +46,24 @@ function JobListPopout({ details, onClose, situation }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const apiCall = useMemo(() => new usersService(), []);
|
const apiCall = useMemo(() => new usersService(), []);
|
||||||
|
const { walletDetails } = useSelector((state) => state.walletDetails);
|
||||||
|
|
||||||
|
const getWalletDetail = (currency) => {
|
||||||
|
// A FUNCTION TO GET USER BALANCE BASED ON TASK CURRENCY
|
||||||
|
const walletChecker = walletDetails?.data.find(
|
||||||
|
(item) => item.description === currency
|
||||||
|
);
|
||||||
|
return walletChecker
|
||||||
|
? {
|
||||||
|
description: walletChecker.description,
|
||||||
|
country: walletChecker.country,
|
||||||
|
code: walletChecker.code,
|
||||||
|
amount: walletChecker.amount,
|
||||||
|
}
|
||||||
|
: 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
const taskWalletSelector = getWalletDetail(details?.currency);
|
||||||
|
|
||||||
// member listing
|
// member listing
|
||||||
const memberList = useCallback(async () => {
|
const memberList = useCallback(async () => {
|
||||||
@@ -219,7 +238,7 @@ function JobListPopout({ details, onClose, situation }) {
|
|||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// console.log("Job List P >> ", details)
|
console.log("wallet >> ", walletDetails, details, taskWalletSelector);
|
||||||
return (
|
return (
|
||||||
<ModalCom action={onClose} situation={situation} className="">
|
<ModalCom action={onClose} situation={situation} className="">
|
||||||
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
@@ -295,188 +314,193 @@ function JobListPopout({ details, onClose, situation }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* ACTION SECTION */}
|
<>
|
||||||
<div className="px-4 pb-3 w-ful flex flex-col justify-between">
|
{/* ACTION SECTION */}
|
||||||
<h1 className="text-lg mt-3 font-medium tracking-wide text-black dark:text-white">
|
{+taskWalletSelector.amount > +details.price ? (
|
||||||
Send this Task to:
|
<div className="px-4 pb-3 w-full flex flex-col justify-between">
|
||||||
</h1>
|
<h1 className="text-lg mt-3 font-medium tracking-wide text-black dark:text-white">
|
||||||
<div className="flex flex-col grow">
|
Send this Task to:
|
||||||
<div className="grid grid-cols-3 mt-4">
|
</h1>
|
||||||
{tabs.map((item) => (
|
<div className="flex flex-col grow">
|
||||||
<button
|
<div className="grid grid-cols-3 mt-4">
|
||||||
// className={`px-4 py-1 rounded-t-2xl ${selectedTab == item ? 'btn-gradient border-[2px] text-white' : 'bg-white text-[#000] border-t-[2px]'}`}
|
{tabs.map((item) => (
|
||||||
className={`px-4 py-1 rounded-t-2xl border-t-[2px] transition-all duration-200 flex flex-col justify-center items-center ${
|
<button
|
||||||
selectedTab == item
|
// className={`px-4 py-1 rounded-t-2xl ${selectedTab == item ? 'btn-gradient border-[2px] text-white' : 'bg-white text-[#000] border-t-[2px]'}`}
|
||||||
? "bg-red-50 dark:bg-[#D85A5A] text-slate-600 font-extrabold"
|
className={`px-4 py-1 rounded-t-2xl border-t-[2px] transition-all duration-200 flex flex-col justify-center items-center ${
|
||||||
: "bg-white text-[#000]"
|
selectedTab == item
|
||||||
}`}
|
? "bg-red-50 dark:bg-[#D85A5A] text-slate-600 font-extrabold"
|
||||||
value={item}
|
: "bg-white text-[#000]"
|
||||||
name={item}
|
}`}
|
||||||
onClick={() => setSelectedTab(item)}
|
value={item}
|
||||||
>
|
name={item}
|
||||||
<div
|
onClick={() => setSelectedTab(item)}
|
||||||
className={`mb-[1px] h-6 w-6 border-4 rounded-full transition-all duration-200 ${
|
>
|
||||||
selectedTab == item
|
<div
|
||||||
? "border-white bg-emerald-500"
|
className={`mb-[1px] h-6 w-6 border-4 rounded-full transition-all duration-200 ${
|
||||||
: "border-red-50 dark:border-[#D85A5A] bg-white"
|
selectedTab == item
|
||||||
|
? "border-white bg-emerald-500"
|
||||||
|
: "border-red-50 dark:border-[#D85A5A] bg-white"
|
||||||
|
}`}
|
||||||
|
></div>
|
||||||
|
{item[0].toUpperCase() + item.slice(1)}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className="grow flex flex-col bg-red-50 dark:bg-[#D85A5A] rounded-b-2xl">
|
||||||
|
{selectedTab == "family" && (
|
||||||
|
<Formik
|
||||||
|
initialValues={initialValues}
|
||||||
|
validationSchema={validationSchema.fields.family}
|
||||||
|
onSubmit={jobFieldHandler}
|
||||||
|
>
|
||||||
|
{(props) => {
|
||||||
|
return (
|
||||||
|
<Form className="hidden">
|
||||||
|
{/* Assign to Family */}
|
||||||
|
<JobFieldInput
|
||||||
|
label="Assign to family"
|
||||||
|
select={true}
|
||||||
|
inputName="family"
|
||||||
|
value={props?.values.family}
|
||||||
|
data={familyList}
|
||||||
|
btnText="Assign to family"
|
||||||
|
optionText="Select Family"
|
||||||
|
loader={loader?.jobFields?.family}
|
||||||
|
errorHandler={errorHandler}
|
||||||
|
parentClass="w-full flex flex-col gap-4"
|
||||||
|
/>
|
||||||
|
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||||
|
{" "}
|
||||||
|
{props?.values?.family === "" && (
|
||||||
|
<span>{errMsg?.jobFields?.family}</span>
|
||||||
|
)}
|
||||||
|
</p>{" "}
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Formik>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{selectedTab == "public" && (
|
||||||
|
<Formik
|
||||||
|
initialValues={initialValues}
|
||||||
|
validationSchema={validationSchema.fields.public}
|
||||||
|
onSubmit={jobFieldHandler}
|
||||||
|
>
|
||||||
|
{(props) => {
|
||||||
|
return (
|
||||||
|
<Form className="">
|
||||||
|
{/* Offer this job to public input */}
|
||||||
|
<JobFieldInput
|
||||||
|
label="Offer this job to public"
|
||||||
|
select={true}
|
||||||
|
inputName="public"
|
||||||
|
value={props?.values.public}
|
||||||
|
data={publicArray}
|
||||||
|
btnText="Show Task to Public"
|
||||||
|
optionText="Select Duration"
|
||||||
|
loader={loader?.jobFields?.public}
|
||||||
|
errorHandler={errorHandler}
|
||||||
|
parentClass="w-full flex flex-col gap-4"
|
||||||
|
/>
|
||||||
|
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||||
|
{" "}
|
||||||
|
{props?.values.public === "" && (
|
||||||
|
<span>{errMsg?.jobFields?.public}</span>
|
||||||
|
)}
|
||||||
|
</p>{" "}
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Formik>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{selectedTab == "individual" && (
|
||||||
|
<Formik
|
||||||
|
initialValues={initialValues}
|
||||||
|
validationSchema={validationSchema.fields.individual}
|
||||||
|
onSubmit={jobFieldHandler}
|
||||||
|
>
|
||||||
|
{(props) => {
|
||||||
|
return (
|
||||||
|
<Form className="">
|
||||||
|
{/* Offer this job to individual input */}
|
||||||
|
<JobFieldInput
|
||||||
|
label="Offer this job to individual"
|
||||||
|
input={true}
|
||||||
|
inputName="individual"
|
||||||
|
value={props?.values.individual}
|
||||||
|
placeholder="Enter email of individual"
|
||||||
|
inputHandler={props?.handleChange}
|
||||||
|
btnText="Send Offer to Individual"
|
||||||
|
loader={loader?.jobFields?.individual}
|
||||||
|
errorHandler={errorHandler}
|
||||||
|
parentClass="w-full flex flex-col gap-4"
|
||||||
|
/>
|
||||||
|
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||||
|
{" "}
|
||||||
|
{props?.values.individual === "" && (
|
||||||
|
<span>{errMsg?.jobFields?.individual}</span>
|
||||||
|
)}
|
||||||
|
</p>{" "}
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Formik>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* { process.env.REACT_APP_SHOW_OFFER_GROUP_JOB != 0 && } */}
|
||||||
|
{selectedTab == "group" && (
|
||||||
|
<Formik
|
||||||
|
initialValues={initialValues}
|
||||||
|
validationSchema={validationSchema.fields.group}
|
||||||
|
onSubmit={jobFieldHandler}
|
||||||
|
>
|
||||||
|
{(props) => {
|
||||||
|
return (
|
||||||
|
<Form className="">
|
||||||
|
{/* Offer this job to your group input */}
|
||||||
|
<JobFieldInput
|
||||||
|
label="Offer this job to your Group"
|
||||||
|
select={true}
|
||||||
|
inputName="group"
|
||||||
|
value={props?.values.group}
|
||||||
|
btnText="Send Order to Group"
|
||||||
|
optionText="Select Group"
|
||||||
|
loader={loader?.jobFields?.group}
|
||||||
|
errorHandler={errorHandler}
|
||||||
|
data={groupList}
|
||||||
|
parentClass="w-full flex flex-col gap-4"
|
||||||
|
/>
|
||||||
|
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||||
|
{" "}
|
||||||
|
{props?.values.group === "" && (
|
||||||
|
<span>{errMsg?.jobFields?.group}</span>
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Formik>
|
||||||
|
)}
|
||||||
|
<p
|
||||||
|
className={`text-center w-full text-lg ${
|
||||||
|
requestStatus.status
|
||||||
|
? "text-emerald-600"
|
||||||
|
: "text-red-600"
|
||||||
}`}
|
}`}
|
||||||
></div>
|
>
|
||||||
{item[0].toUpperCase() + item.slice(1)}
|
{requestStatus.message && requestStatus.message}
|
||||||
</button>
|
</p>
|
||||||
))}
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grow flex flex-col bg-red-50 dark:bg-[#D85A5A] rounded-b-2xl">
|
) : (
|
||||||
{selectedTab == "family" && (
|
<ZeroBalanceChecker {...taskWalletSelector} />
|
||||||
<Formik
|
)}
|
||||||
initialValues={initialValues}
|
|
||||||
validationSchema={validationSchema.fields.family}
|
|
||||||
onSubmit={jobFieldHandler}
|
|
||||||
>
|
|
||||||
{(props) => {
|
|
||||||
return (
|
|
||||||
<Form className="hidden">
|
|
||||||
{/* Assign to Family */}
|
|
||||||
<JobFieldInput
|
|
||||||
label="Assign to family"
|
|
||||||
select={true}
|
|
||||||
inputName="family"
|
|
||||||
value={props?.values.family}
|
|
||||||
data={familyList}
|
|
||||||
btnText="Assign to family"
|
|
||||||
optionText="Select Family"
|
|
||||||
loader={loader?.jobFields?.family}
|
|
||||||
errorHandler={errorHandler}
|
|
||||||
parentClass="w-full flex flex-col gap-4"
|
|
||||||
/>
|
|
||||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
|
||||||
{" "}
|
|
||||||
{props?.values?.family === "" && (
|
|
||||||
<span>{errMsg?.jobFields?.family}</span>
|
|
||||||
)}
|
|
||||||
</p>{" "}
|
|
||||||
</Form>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Formik>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{selectedTab == "public" && (
|
{/* END OF ACTION SECTION */}
|
||||||
<Formik
|
</>
|
||||||
initialValues={initialValues}
|
|
||||||
validationSchema={validationSchema.fields.public}
|
|
||||||
onSubmit={jobFieldHandler}
|
|
||||||
>
|
|
||||||
{(props) => {
|
|
||||||
return (
|
|
||||||
<Form className="">
|
|
||||||
{/* Offer this job to public input */}
|
|
||||||
<JobFieldInput
|
|
||||||
label="Offer this job to public"
|
|
||||||
select={true}
|
|
||||||
inputName="public"
|
|
||||||
value={props?.values.public}
|
|
||||||
data={publicArray}
|
|
||||||
btnText="Show Task to Public"
|
|
||||||
optionText="Select Duration"
|
|
||||||
loader={loader?.jobFields?.public}
|
|
||||||
errorHandler={errorHandler}
|
|
||||||
parentClass="w-full flex flex-col gap-4"
|
|
||||||
/>
|
|
||||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
|
||||||
{" "}
|
|
||||||
{props?.values.public === "" && (
|
|
||||||
<span>{errMsg?.jobFields?.public}</span>
|
|
||||||
)}
|
|
||||||
</p>{" "}
|
|
||||||
</Form>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Formik>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{selectedTab == "individual" && (
|
|
||||||
<Formik
|
|
||||||
initialValues={initialValues}
|
|
||||||
validationSchema={validationSchema.fields.individual}
|
|
||||||
onSubmit={jobFieldHandler}
|
|
||||||
>
|
|
||||||
{(props) => {
|
|
||||||
return (
|
|
||||||
<Form className="">
|
|
||||||
{/* Offer this job to individual input */}
|
|
||||||
<JobFieldInput
|
|
||||||
label="Offer this job to individual"
|
|
||||||
input={true}
|
|
||||||
inputName="individual"
|
|
||||||
value={props?.values.individual}
|
|
||||||
placeholder="Enter email of individual"
|
|
||||||
inputHandler={props?.handleChange}
|
|
||||||
btnText="Send Offer to Individual"
|
|
||||||
loader={loader?.jobFields?.individual}
|
|
||||||
errorHandler={errorHandler}
|
|
||||||
parentClass="w-full flex flex-col gap-4"
|
|
||||||
/>
|
|
||||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
|
||||||
{" "}
|
|
||||||
{props?.values.individual === "" && (
|
|
||||||
<span>{errMsg?.jobFields?.individual}</span>
|
|
||||||
)}
|
|
||||||
</p>{" "}
|
|
||||||
</Form>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Formik>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* { process.env.REACT_APP_SHOW_OFFER_GROUP_JOB != 0 && } */}
|
|
||||||
{selectedTab == "group" && (
|
|
||||||
<Formik
|
|
||||||
initialValues={initialValues}
|
|
||||||
validationSchema={validationSchema.fields.group}
|
|
||||||
onSubmit={jobFieldHandler}
|
|
||||||
>
|
|
||||||
{(props) => {
|
|
||||||
return (
|
|
||||||
<Form className="">
|
|
||||||
{/* Offer this job to your group input */}
|
|
||||||
<JobFieldInput
|
|
||||||
label="Offer this job to your Group"
|
|
||||||
select={true}
|
|
||||||
inputName="group"
|
|
||||||
value={props?.values.group}
|
|
||||||
btnText="Send Order to Group"
|
|
||||||
optionText="Select Group"
|
|
||||||
loader={loader?.jobFields?.group}
|
|
||||||
errorHandler={errorHandler}
|
|
||||||
data={groupList}
|
|
||||||
parentClass="w-full flex flex-col gap-4"
|
|
||||||
/>
|
|
||||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
|
||||||
{" "}
|
|
||||||
{props?.values.group === "" && (
|
|
||||||
<span>{errMsg?.jobFields?.group}</span>
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
</Form>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Formik>
|
|
||||||
)}
|
|
||||||
<p
|
|
||||||
className={`text-center w-full text-lg ${
|
|
||||||
requestStatus.status ? "text-emerald-600" : "text-red-600"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{requestStatus.message && requestStatus.message}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/*
|
|
||||||
{requestStatus.message &&
|
|
||||||
<p className={`mt-4 w-full text-lg ${requestStatus.status ? 'text-emerald-600' : 'text-red-600'}`}>{requestStatus.message}</p>
|
|
||||||
} */}
|
|
||||||
</div>
|
|
||||||
{/* END OF ACTION SECTION */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ModalCom>
|
</ModalCom>
|
||||||
@@ -628,3 +652,19 @@ const publicArray = [
|
|||||||
{ duration: 21, name: "3 weeks" },
|
{ duration: 21, name: "3 weeks" },
|
||||||
{ duration: 28, name: "4 weeks" },
|
{ duration: 28, name: "4 weeks" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const ZeroBalanceChecker = ({ amount, code, country }) => {
|
||||||
|
let thePrice = PriceFormatter(amount * 0.01, code, country);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="px-4 pb-3 w-full flex flex-col gap-5 items-center">
|
||||||
|
<h1 className="text-lg mt-3 font-medium tracking-wide text-black dark:text-white">
|
||||||
|
Wallet Balance:{` ${code} ${amount}`}
|
||||||
|
</h1>
|
||||||
|
<p className="font-semibold text-center text-red-500 text-lg">You do not have sufficient balance to assign this task</p>
|
||||||
|
<button className="btn-gradient w-48 h-[46px] text-white rounded-full text-base bg-pink flex justify-center items-center">
|
||||||
|
Add Credit to Wallet
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
localStorage.removeItem("member_id");
|
localStorage.removeItem("member_id");
|
||||||
localStorage.removeItem("session_token");
|
localStorage.removeItem("session_token");
|
||||||
sessionStorage.removeItem("family_uid");
|
sessionStorage.removeItem("family_uid");
|
||||||
|
localStorage.clear();
|
||||||
navigate("/login", { replace: true }); // redirects user to login page after session expires
|
navigate("/login", { replace: true }); // redirects user to login page after session expires
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user