Compare commits

...

23 Commits

Author SHA1 Message Date
victorAnumudu 4f1a4dd045 Delete/Edit Btn Position Changed 2023-05-15 21:16:18 +01:00
ameye f755786adc Merge branch 'transfer-fund-page' of WrenchBoard/Users-Wrench into master 2023-05-15 13:06:23 +00:00
Ebube 19f111c6a8 fixed button for family acc 2023-05-15 12:28:31 +01:00
CHIEFSOFT\ameye c877c70bf0 Active Jobs 2023-05-14 21:49:08 -04:00
CHIEFSOFT\ameye 7c2f90b1b8 active pending jobs 2023-05-14 13:33:08 -04:00
ameye 872ba05a01 Merge branch 'positioning-delete-edit-btn' of WrenchBoard/Users-Wrench into master 2023-05-14 12:06:35 +00:00
victorAnumudu 7083e67667 Positioned the delete and edit button in my jobs list 2023-05-14 07:33:46 +01:00
ameye 94e7c549df Merge branch 'job-page-layout-fix' of WrenchBoard/Users-Wrench into master 2023-05-13 14:48:37 +00:00
victorAnumudu 0d013c261b Job layout implemented 2023-05-13 14:04:40 +01:00
ameye 60eca6e703 Merge branch 'deleted-job-api-implementation' of WrenchBoard/Users-Wrench into master 2023-05-12 20:48:20 +00:00
victorAnumudu d51c9dc55d delete job api implementation 2023-05-12 21:07:17 +01:00
ameye c7985e6b48 Merge branch 'transfer-fund-page' of WrenchBoard/Users-Wrench into master 2023-05-12 19:00:31 +00:00
Ebube 985dc58f37 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into transfer-fund-page 2023-05-12 19:07:40 +01:00
Ebube d3a19d0a31 changed layout 2023-05-12 19:06:53 +01:00
tokslaw e1a7b8647b Merge branch 'delete-job-implementation' of WrenchBoard/Users-Wrench into master 2023-05-12 15:18:02 +00:00
victorAnumudu 77bc0ca795 delete job implemented 2023-05-12 16:06:59 +01:00
ameye 7a5e5580f9 Merge branch 'add-family-acc' of WrenchBoard/Users-Wrench into master 2023-05-12 08:46:22 +00:00
Ebube 666389cff6 cleanup 2023-05-12 09:06:42 +01:00
Ebube 3d084a99f3 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into add-family-acc 2023-05-12 08:56:55 +01:00
Ebube 6bb7da4639 fixed popup 2023-05-12 08:56:21 +01:00
CHIEFSOFT\ameye 2fd0aaa89c google login starter 2023-05-11 23:30:10 -04:00
CHIEFSOFT\ameye c21c67c336 balance page 2023-05-11 21:21:11 -04:00
ameye 9f8b9d317b Merge branch 'implementing-zero-state' of WrenchBoard/Users-Wrench into master 2023-05-11 21:05:09 +00:00
22 changed files with 794 additions and 493 deletions
+1
View File
@@ -3,6 +3,7 @@
"version": "0.2.0", "version": "0.2.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@react-oauth/google": "^0.11.0",
"@reduxjs/toolkit": "^1.8.2", "@reduxjs/toolkit": "^1.8.2",
"@tailwindcss/line-clamp": "^0.3.1", "@tailwindcss/line-clamp": "^0.3.1",
"@testing-library/jest-dom": "^5.11.4", "@testing-library/jest-dom": "^5.11.4",
+2
View File
@@ -35,6 +35,7 @@ import MyActiveJobsPage from "./views/MyActiveJobsPage";
import FamilyAccPage from "./views/FamilyAccPage"; import FamilyAccPage from "./views/FamilyAccPage";
import StartJob from "./components/MyJobs/StartJob"; import StartJob from "./components/MyJobs/StartJob";
import AddJobPage from "./views/AddJobPage"; import AddJobPage from "./views/AddJobPage";
import MyPendingJobsPage from "./views/MyPendingJobsPage";
export default function Routers() { export default function Routers() {
return ( return (
@@ -79,6 +80,7 @@ export default function Routers() {
<Route exact path="/myjobs" element={<MyJobsPage />} /> <Route exact path="/myjobs" element={<MyJobsPage />} />
<Route exact path="/add-job" element={<AddJobPage />} /> <Route exact path="/add-job" element={<AddJobPage />} />
<Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} /> <Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} />
<Route exact path="/my-pending-jobs" element={<MyPendingJobsPage />} />
<Route exact path="/acc-family" element={<FamilyAccPage />} /> <Route exact path="/acc-family" element={<FamilyAccPage />} />
<Route exact path="/start-job" element={<StartJob />} /> <Route exact path="/start-job" element={<StartJob />} />
<Route <Route
+14 -3
View File
@@ -36,7 +36,7 @@ const validationSchema = Yup.object().shape({
let initialValues = { // initial values for formik let initialValues = { // initial values for formik
country: '', country: '',
price: '', price: 0,
title: '', title: '',
description: '', description: '',
job_detail: '', job_detail: '',
@@ -69,7 +69,6 @@ function AddJob() {
// FUNCTION TO HANDLE ADD JOB FORM // FUNCTION TO HANDLE ADD JOB FORM
const handleAddJob = (values, helpers) => { const handleAddJob = (values, helpers) => {
console.log(values)
setRequestStatus({loading: true, status: false, message:''}) setRequestStatus({loading: true, status: false, message:''})
ApiCall.jobManagerCreateJob(values).then(res => { ApiCall.jobManagerCreateJob(values).then(res => {
if(res.data.internal_return < 1){ if(res.data.internal_return < 1){
@@ -83,6 +82,10 @@ function AddJob() {
}).catch(err => { }).catch(err => {
setRequestStatus({loading: false, status: false, message:'Opps! soemthing went wrong. Try Again'}) setRequestStatus({loading: false, status: false, message:'Opps! soemthing went wrong. Try Again'})
}).finally(()=>{
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message:''})
}, 5000)
}) })
} }
@@ -134,8 +137,10 @@ function AddJob() {
<select <select
id='country' id='country'
name='country' name='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`} 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`}
onChange={props.handleChange} onChange={props.handleChange}
onBlur={props.handleBlur}
> >
{country.loading ? ( {country.loading ? (
<option className="text-slate-500 text-lg" value=""> <option className="text-slate-500 text-lg" value="">
@@ -176,11 +181,13 @@ function AddJob() {
label="Price" label="Price"
labelClass='tracking-wide' labelClass='tracking-wide'
inputBg = 'bg-slate-100' inputBg = 'bg-slate-100'
type="text" type="number"
name="price" name="price"
fieldClass='text-right'
// placeholder="Please Enter Amount" // placeholder="Please Enter Amount"
value={props.values.price} value={props.values.price}
inputHandler={props.handleChange} inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/> />
{props.errors.price && props.touched.price && ( {props.errors.price && props.touched.price && (
<p className="text-sm text-red-500"> <p className="text-sm text-red-500">
@@ -203,6 +210,7 @@ function AddJob() {
// placeholder="Enter Job Title" // placeholder="Enter Job Title"
value={props.values.title} value={props.values.title}
inputHandler={props.handleChange} inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/> />
{props.errors.title && props.touched.title && ( {props.errors.title && props.touched.title && (
<p className="text-sm text-red-500"> <p className="text-sm text-red-500">
@@ -223,6 +231,7 @@ function AddJob() {
// placeholder="Enter a description" // placeholder="Enter a description"
value={props.values.description} value={props.values.description}
inputHandler={props.handleChange} inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/> />
{props.errors.description && props.touched.description && ( {props.errors.description && props.touched.description && (
<p className="text-sm text-red-500"> <p className="text-sm text-red-500">
@@ -255,6 +264,7 @@ function AddJob() {
name='job_detail' name='job_detail'
value={props.values.job_detail} value={props.values.job_detail}
onChange={props.handleChange} onChange={props.handleChange}
onBlur={props.handleBlur}
/> />
{props.errors.job_detail && props.touched.job_detail && ( {props.errors.job_detail && props.touched.job_detail && (
<p className="text-sm text-red-500"> <p className="text-sm text-red-500">
@@ -275,6 +285,7 @@ function AddJob() {
// placeholder="Please Enter Detail Description of Job" // placeholder="Please Enter Detail Description of Job"
value={props.values.timeline_days} value={props.values.timeline_days}
inputHandler={props.handleChange} inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/> />
{props.errors.timeline_days && props.touched.timeline_days && ( {props.errors.timeline_days && props.touched.timeline_days && (
<p className="text-sm text-red-500"> <p className="text-sm text-red-500">
+24 -1
View File
@@ -7,6 +7,8 @@ import WrenchBoard from "../../../assets/images/wrenchboard.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 "../AuthLayout"; import AuthLayout from "../AuthLayout";
//import { GoogleOAuthProvider } from '@react-oauth/google';
// import { googleLogout, useGoogleLogin } from '@react-oauth/google';
import { useDispatch } from "react-redux"; import { useDispatch } from "react-redux";
import { updateUserDetails } from "../../../store/UserDetails"; import { updateUserDetails } from "../../../store/UserDetails";
@@ -197,10 +199,31 @@ export default function Login() {
} }
const BrandBtn = ({ link, imgSrc, brand }) => { const BrandBtn = ({ link, imgSrc, brand }) => {
const doGoogle = async ()=>{
alert('start google');
}
// onSuccess: (codeResponse) => setUser(codeResponse),
// const doGoogle = useGoogleLogin({
// onSuccess: (codeResponse) => console.log('Login onSuccess:', codeResponse),
// onError: (error) => console.log('Login Failed:', error)
// });
const doApple = async ()=>{
alert('start apple');
}
const doFacebook = async ()=>{
alert('start facebook');
}
return ( return (
<div className="flex justify-center bottomMargin"> <div className="flex justify-center bottomMargin">
<a <a
href={link} // onClick={doGoogle}
href="#dd"
className="w-full border border-light-purple dark:border-[#5356fb29] rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 dark:bg-[#11131F] items-center font-medium cursor-pointer" className="w-full border border-light-purple dark:border-[#5356fb29] rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 dark:bg-[#11131F] items-center font-medium cursor-pointer"
> >
<img className="mr-3 h-6" src={imgSrc} alt="logo-icon(s)" /> <img className="mr-3 h-6" src={imgSrc} alt="logo-icon(s)" />
+12 -7
View File
@@ -1,9 +1,10 @@
import React, { useState } from "react"; import React, { useState } from "react";
import dataImage1 from "../../assets/images/data-table-user-1.png"; import dataImage1 from "../../assets/images/data-table-user-1.png";
import LoadingSpinner from "../Spinners/LoadingSpinner";
export default function FamilyTable({ className, familyList, loader }) { export default function FamilyTable({ className, familyList, loader }) {
const filterCategories = ["All Categories", "Explore", "Featured"]; const filterCategories = ["All Categories", "Explore", "Featured"];
console.log(familyList)
const [selectedCategory, setCategory] = useState(filterCategories[0]); const [selectedCategory, setCategory] = useState(filterCategories[0]);
return ( return (
<div <div
@@ -12,7 +13,13 @@ export default function FamilyTable({ className, familyList, loader }) {
}`} }`}
> >
<div className="relative w-full overflow-x-auto sm:rounded-lg"> <div className="relative w-full overflow-x-auto sm:rounded-lg">
{loader ? (
<div className="h-full min-h-[500px] w-full overflow-hidden flex justify-center items-center">
<LoadingSpinner size='16' color='sky-blue' />
</div>
) : (
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative"> <table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
<>
<thead className="sticky top-0"> <thead className="sticky top-0">
<tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-bottom "> <tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-bottom ">
<th className="py-4">Name</th> <th className="py-4">Name</th>
@@ -22,9 +29,6 @@ export default function FamilyTable({ className, familyList, loader }) {
</tr> </tr>
</thead> </thead>
<tbody className="overflow-y-scroll h-auto"> <tbody className="overflow-y-scroll h-auto">
{loader ? (
<div className="signup btn-loader"></div>
) : (
<> <>
{familyList?.length > 0 ? ( {familyList?.length > 0 ? (
familyList?.map(({ firstname, lastname, age }, idx) => ( familyList?.map(({ firstname, lastname, age }, idx) => (
@@ -77,16 +81,17 @@ export default function FamilyTable({ className, familyList, loader }) {
</tr> </tr>
)) ))
) : ( ) : (
<tr class="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap"> <tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td class="p-2" colspan="4"> <td className="p-2" colSpan="4">
No Family Accounts Found! No Family Accounts Found!
</td> </td>
</tr> </tr>
)} )}
</> </>
)}
</tbody> </tbody>
</>
</table> </table>
)}
</div> </div>
</div> </div>
); );
+71 -35
View File
@@ -1,15 +1,14 @@
import React, { useCallback, useEffect, useId, useMemo, useState } from "react"; import React, { useCallback, useEffect, useMemo, useState } from "react";
import CustomPopUp from "../Helpers/CustomPopUp";
import InputCom from "../Helpers/Inputs/InputCom"; import InputCom from "../Helpers/Inputs/InputCom";
import Layout from "../Partials/Layout"; import Layout from "../Partials/Layout";
import FamilyTable from "./FamilyTable"; import FamilyTable from "./FamilyTable";
import SiteService from "../../services/SiteService"; import SiteService from "../../services/SiteService";
import ModalCom from "../Helpers/ModalCom";
export default function FamilyAcc() { export default function FamilyAcc() {
const [selectTab, setValue] = useState("today"); const [selectTab, setValue] = useState("today");
const [selectedAge, setSelectedAge] = useState(undefined); const [selectedAge, setSelectedAge] = useState(undefined);
const [familyList, setFamilyList] = useState([]); const [familyList, setFamilyList] = useState([]);
const [isOpen, setIsOpen] = useState(false);
const [loader, setLoader] = useState(false); const [loader, setLoader] = useState(false);
const [popUp, setPopUp] = useState(false); const [popUp, setPopUp] = useState(false);
const [listReload, setListReload] = useState(false); const [listReload, setListReload] = useState(false);
@@ -27,7 +26,7 @@ export default function FamilyAcc() {
let sessionId = localStorage.getItem("session_token"); let sessionId = localStorage.getItem("session_token");
const popUpHandler = () => { const popUpHandler = () => {
setPopUp(!popUp); setPopUp((prev) => !prev);
}; };
// tab handler // tab handler
@@ -35,7 +34,6 @@ export default function FamilyAcc() {
setValue(value); setValue(value);
}; };
let id = useId();
// For the age drop down // For the age drop down
let startAge = 5; let startAge = 5;
let endAge = 16; let endAge = 16;
@@ -68,13 +66,13 @@ export default function FamilyAcc() {
lastname: last_name, lastname: last_name,
age: selectedAge, age: selectedAge,
}; };
console.log(reqData);
let res = await apiCall.addFamily(reqData); let res = await apiCall.addFamily(reqData);
const { data } = res; const { data } = res;
if (data?.internal_return > 0 && data?.status == "OK") { if (data?.internal_return > 0 && data?.status == "OK") {
setLoader(false); setLoader(false);
setListReload((prev) => !prev); setListReload((prev) => !prev);
setIsOpen(false);
} else { } else {
setLoader(false); setLoader(false);
setMsgErr("Sorry, something went wrong"); setMsgErr("Sorry, something went wrong");
@@ -136,32 +134,19 @@ export default function FamilyAcc() {
{/* heading */} {/* heading */}
<div className="sm:flex justify-between items-center mb-6"> <div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0"> <div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold inline-flex gap-2 text-dark-gray dark:text-white"> <h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
<span <span
className={`${selectTab === "today" ? "block" : "hidden"}`} className={`${selectTab === "today" ? "block" : "hidden"}`}
> >
Family Accounts Family Accounts
</span> </span>
<CustomPopUp <button
name="(Add)" onClick={popUpHandler}
btn_class="text-purple" type="button"
key={id} className="text-white btn-gradient text-lg tracking-wide px-5 py-2 rounded-full"
title="Add members"
isOpen={isOpen}
setIsOpen={setIsOpen}
modalHandler={popUpHandler}
> >
<FamilyForm Add
value={formData} </button>
ageHandler={handleAgeSelect}
ageRange={ageRange}
ageValue={selectedAge}
inputHandler={handleInputChange}
msgErr={msgErr}
onClick={addMember}
loader={loader}
/>
</CustomPopUp>
</h1> </h1>
</div> </div>
<div className="slider-btns flex space-x-4"> <div className="slider-btns flex space-x-4">
@@ -174,6 +159,21 @@ export default function FamilyAcc() {
<FamilyTable familyList={familyList} loader={loader} /> <FamilyTable familyList={familyList} loader={loader} />
</div> </div>
</div> </div>
{popUp && (
<ModalCom action={popUpHandler} situation={popUp}>
<FamilyForm
popUpHandler={popUpHandler}
value={formData}
ageHandler={handleAgeSelect}
ageRange={ageRange}
ageValue={selectedAge}
inputHandler={handleInputChange}
msgErr={msgErr}
onClick={addMember}
loader={loader}
/>
</ModalCom>
)}
</Layout> </Layout>
); );
} }
@@ -187,16 +187,29 @@ const FamilyForm = ({
msgErr, msgErr,
loader, loader,
onClick, onClick,
popUpHandler,
}) => { }) => {
return ( return (
<div className="w-full relative block "> <div className="logout-modal-wrapper lg:w-[460px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<form className="flex flex-col gap-4"> <div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple dark:border-[#5356fb29] ">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Add Members
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
onClick={popUpHandler}
>
<CloseIcon />
</button>
</div>
<form className="logout-modal-body w-full flex flex-col items-center px-10 py-8 gap-4">
<InputCom <InputCom
placeholder="Firstname" placeholder="Firstname"
label="First Name:" label="First Name:"
name="first_name" name="first_name"
type="text" type="text"
parentClass="flex items-center gap-1" parentClass="flex items-center gap-1 w-full"
labelClass="flex-[0.2] mb-0" labelClass="flex-[0.2] mb-0"
inputClass="flex-[0.8]" inputClass="flex-[0.8]"
fieldClass="px-2" fieldClass="px-2"
@@ -208,14 +221,14 @@ const FamilyForm = ({
label="Last Name:" label="Last Name:"
name="last_name" name="last_name"
type="text" type="text"
parentClass="flex items-center gap-1" parentClass="flex items-center gap-1 w-full"
labelClass="flex-[0.2] mb-0" labelClass="flex-[0.2] mb-0"
inputClass="flex-[0.8]" inputClass="flex-[0.8]"
fieldClass="px-2" fieldClass="px-2"
value={last_name} value={last_name}
inputHandler={inputHandler} inputHandler={inputHandler}
/> />
<div className="input-com mb-7 flex gap-1 items-center"> <div className="input-com mb-7 flex gap-1 items-center w-full justify-between">
{/* Age dropdown */} {/* Age dropdown */}
<div className="flex items-center justify-between flex-[0.3]"> <div className="flex items-center justify-between flex-[0.3]">
<label <label
@@ -225,7 +238,7 @@ const FamilyForm = ({
Select your age: Select your age:
</label> </label>
</div> </div>
<div className=" flex-[0.7]"> <div className=" flex-[0.7] max-w-[150px]">
<select <select
name="age-selection" name="age-selection"
id="age-selection" id="age-selection"
@@ -248,12 +261,13 @@ const FamilyForm = ({
{msgErr} {msgErr}
</div> </div>
)} )}
<div className="signin-area"> <div className="signin-area w-full">
<div className="flex justify-center"> <div className="flex justify-center">
<button <button
type="button" type="button"
onClick={onClick} onClick={onClick}
className={`rounded-[0.475rem] text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center h-[42px] py-[0.8875rem] px-[1.81rem] text-[14.95px] btn-login`} // className={`rounded-[0.475rem] text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center h-[42px] py-[0.8875rem] px-[1.81rem] text-[14.95px] btn-login`}
className="text-white btn-gradient text-lg tracking-wide px-6 py-2 rounded-full"
> >
{loader ? ( {loader ? (
<div className="signup btn-loader"></div> <div className="signup btn-loader"></div>
@@ -267,3 +281,25 @@ const FamilyForm = ({
</div> </div>
); );
}; };
const CloseIcon = () => (
<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>
);
@@ -1,80 +0,0 @@
import React, { useEffect } from "react";
const CustomPopUp = ({
name,
btn_class,
title,
children,
isOpen,
setIsOpen,
modalHandler,
}) => {
const handleOpen = () => {
setIsOpen(true);
};
const handleClose = () => {
setIsOpen(false);
};
useEffect(() => {
if (modalHandler) {
document.body.style.overflowY = "hidden";
}
return () => {
document.body.style.overflowY = "unset";
};
});
return (
<div>
<button onClick={handleOpen} className={btn_class}>
{name}
</button>
{isOpen && (
<div className="modal-com">
<div
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`}
></div>
<div className="children-element fixed lg:h-100vh h-full z-[99999999999999] w-full lg:w-auto ">
<div className="bg-white rounded-md p-6 shadow-lg transform transition-all duration-300 ease-in-out dark:bg-dark-white logout-modal-wrapper lg:w-[460px] lg:h-auto max-[467px]:max-w-[26rem]">
<div className="w-full flex items-center justify-between lg:px-4 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
{title && (
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide cursor-default">
{title}
</h1>
)}
<button onClick={handleClose}>
<CloseIcon />
</button>
</div>
<div className="logout-modal-body w-full flex flex-col items-center px-4 py-8">
{children && children}
</div>
</div>
</div>
</div>
)}
</div>
);
};
export default CustomPopUp;
const CloseIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={1.5}
stroke="currentColor"
className="w-6 h-6"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
);
+40 -105
View File
@@ -20,119 +20,28 @@ export default function InputCom({
disable, disable,
blurHandler, blurHandler,
spanTag, spanTag,
inputBg inputBg,
direction
}) { }) {
const inputRef = useRef(null); const inputRef = useRef(null);
// Entry Validation // Entry Validation
// for Min Length: // for Min Length:
const minLengthValidation = () => { const minLengthValidation = () => {
if (inputRef && inputRef?.current && inputRef?.current?.name === "email") { const inputConfig = inputConfigs[inputRef?.current?.name]?.minLength;
return 7; return inputConfig || 0;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "first_name"
) {
return 3;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "last_name"
) {
return 3;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "address"
) {
return 5;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "password"
) {
return 8;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "state"
) {
return 3;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "province"
) {
return 3;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "city"
) {
return 3;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "amount"
) {
return 1;
}
}; };
// for MaxLength // for MaxLength
const maxLengthValidation = () => { const maxLengthValidation = () => {
if (inputRef && inputRef?.current && inputRef?.current?.name === "email") { const inputConfig = inputConfigs[inputRef?.current?.name]?.maxLength;
return 35; return inputConfig || 30;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "first_name"
) {
return 25;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "last_name"
) {
return 25;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "address"
) {
return 49;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "password"
) {
return 15;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "state"
) {
return 25;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "province"
) {
return 25;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "city"
) {
return 25;
} else if (
inputRef &&
inputRef?.current &&
inputRef?.current?.name === "amount"
) {
return 9;
}
}; };
// for Patterns
const inputPatterns = () => {
const inputConfig = inputConfigs[inputRef?.current?.name]?.pattern;
return inputConfig || ""
}
return ( return (
<div className={`input-com ${parentClass}`}> <div className={`input-com ${parentClass}`}>
<div className={`flex items-center justify-between mb-2.5 ${labelClass}`}> <div className={`flex items-center justify-between mb-2.5 ${labelClass}`}>
@@ -142,7 +51,11 @@ export default function InputCom({
htmlFor={name} htmlFor={name}
> >
{label} {label}
{spanTag && <span className="text-green-700 text-sm tracking-wide">{spanTag}</span>} {spanTag && (
<span className="text-green-700 text-sm tracking-wide">
{spanTag}
</span>
)}
</label> </label>
)} )}
{forgotPassword && ( {forgotPassword && (
@@ -161,15 +74,19 @@ export default function InputCom({
placeholder={placeholder} placeholder={placeholder}
value={value} value={value}
onChange={inputHandler} onChange={inputHandler}
className={`input-field placeholder:text-base text-dark-gray dark:text-white w-full h-full ${inputBg ? inputBg: 'bg-[#FAFAFA]'} dark:bg-[#11131F] focus:ring-0 focus:outline-none ${fieldClass}`} className={`input-field placeholder:text-base text-dark-gray w-full h-full ${
inputBg ? inputBg : "bg-[#FAFAFA]"
} dark:bg-[#11131F] focus:ring-0 focus:outline-none ${fieldClass}`}
type={type} type={type}
id={name} id={name}
name={name} name={name}
minLength={minLengthValidation()} minLength={minLengthValidation()}
maxLength={maxLengthValidation()} maxLength={maxLengthValidation()}
pattern={() => inputPatterns}
ref={inputRef} ref={inputRef}
readOnly={disable} readOnly={disable}
onBlur={blurHandler} onBlur={blurHandler}
dir={direction}
/> />
{iconName && ( {iconName && (
<div className="absolute right-6 bottom-[10px] z-10"> <div className="absolute right-6 bottom-[10px] z-10">
@@ -188,3 +105,21 @@ export default function InputCom({
</div> </div>
); );
} }
const inputConfigs = {
email: { minLength: 7, maxLength: 30 },
first_name: { minLength: 3, maxLength: 25, pattern: "[a-zA-Z]+" },
last_name: { minLength: 3, maxLength: 25, pattern: "[a-zA-Z]+" },
address: { minLength: 5, maxLength: 49, pattern: "[a-zA-Z0-9]+" },
password: { minLength: 8, maxLength: 15, pattern: ".{8,}" },
state: { minLength: 3, maxLength: 25, pattern: "[a-zA-Z]+" },
province: { minLength: 3, maxLength: 25, pattern: "[a-zA-Z]+" },
city: { minLength: 3, maxLength: 25, pattern: "[a-zA-Z]+" },
amount: { minLength: 1, maxLength: 9, pattern: "[0-9]+" },
};
/* Numbers Only: <input type="text" pattern="[0-9]*" /> strictly numbers
Alphabets Only: <input type="text" pattern="[a-zA-Z]+" /> strictly alphabets
Alphanumeric: <input type="text" pattern="[a-zA-Z0-9]+" /> mix
Password: <input type="text" pattern=".{8,}" /> a minimum of 8 characters
*/
+1 -1
View File
@@ -22,7 +22,7 @@ export default function MyActiveJobs(props) {
<span <span
className={`${selectTab === "today" ? "block" : "hidden"}`} className={`${selectTab === "today" ? "block" : "hidden"}`}
> >
Current Job(s) Active Job(s)
</span> </span>
</h1> </h1>
+20 -8
View File
@@ -5,6 +5,7 @@ import dataImage3 from "../../assets/images/data-table-user-3.png";
import dataImage4 from "../../assets/images/data-table-user-4.png"; import dataImage4 from "../../assets/images/data-table-user-4.png";
import SelectBox from "../Helpers/SelectBox"; import SelectBox from "../Helpers/SelectBox";
import JobListPopout from "../jobPopout/JobListPopout"; import JobListPopout from "../jobPopout/JobListPopout";
import DeleteJobPopout from "../jobPopout/DeleteJobPopout";
import PaginatedList from "../Pagination/PaginatedList"; import PaginatedList from "../Pagination/PaginatedList";
import { handlePagingFunc } from "../Pagination/HandlePagination"; import { handlePagingFunc } from "../Pagination/HandlePagination";
@@ -15,6 +16,8 @@ export default function MyJobTable({MyJobList, className }) {
let [jobPopout,setJobPopout] = useState({show:false, data:{}}) // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW let [jobPopout,setJobPopout] = useState({show:false, data:{}}) // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
let [deleteJobPopout,setDeleteJobPopout] = useState({show:false, data:{}}) // STATE TO HOLD THE VALUE OF THE ITEM DETAILS TO DELETE AND DETERMINE WHEN TO SHOW
const [currentPage, setCurrentPage] = useState(0); const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage); const indexOfFirstItem = Number(currentPage);
const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE); const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
@@ -48,8 +51,8 @@ export default function MyJobTable({MyJobList, className }) {
<table className="table-auto min-w-full text-sm text-left text-gray-500 dark:text-gray-400"> <table className="table-auto min-w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody> <tbody>
<tr className="text-base text-thin-light-gray border-b default-border-b dark:border-[#5356fb29] ottom "> <tr className="text-base text-thin-light-gray border-b default-border-b dark:border-[#5356fb29] ottom ">
<td className="py-8">.</td> <td className="py-1">.</td>
<td className="py-4 text-right">.</td> <td className="py-1 text-right">.</td>
</tr> </tr>
{selectedCategory === "All Categories" ? ( {selectedCategory === "All Categories" ? (
@@ -59,8 +62,8 @@ export default function MyJobTable({MyJobList, className }) {
currentJobList.map((value, index) => ( currentJobList.map((value, index) => (
<tr key={index} className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"> <tr key={index} className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
<td className="py-9"> <td className="py-9">
<div className="sm:flex sm:space-x-2 sm:justify-between sm:items-center job-items">
<div className="flex space-x-2 items-center job-items"> <div className="flex space-x-2 items-center job-items">
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center"> <div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img <img
src={dataImage2} src={dataImage2}
@@ -83,18 +86,21 @@ export default function MyJobTable({MyJobList, className }) {
</span> </span>
</div> </div>
<div className="job-sub-menu"><button type="button" className="w-20 h-11">[Delete]</button> | </div>
<button type="button" className="w-20 h-11">Edit</button> </div>
<div className="min-w-[110px] max-w-[110px] bg-yellow-300 mx-2 rounded-md flex flex-nowrap space-x-2 justify-center items-center self-end">
<button type="button" className="p-2 w-[60px] h-11" onClick={()=>{setDeleteJobPopout({show:true, data:value})}}>[Delete]</button>
<span>|</span>
<button type="button" className="p-2 w-[40px] h-11">Edit</button>
</div>
</div> </div>
</td> </td>
<td className="text-right py-9 px-2">
<td className="text-right py-3 px-2">
<button <button
type="button" type="button"
onClick={()=>{setJobPopout({show:true, data:value})}} onClick={()=>{setJobPopout({show:true, data:value})}}
onClick={()=>{setJobPopout({show:true, data:value})}}
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"
> >
Manage Manage
@@ -128,6 +134,12 @@ export default function MyJobTable({MyJobList, className }) {
<JobListPopout details={jobPopout.data} onClose={()=>{setJobPopout({show:false, data:{}})}} situation={jobPopout.show} /> <JobListPopout details={jobPopout.data} onClose={()=>{setJobPopout({show:false, data:{}})}} situation={jobPopout.show} />
} }
{/* End of Job List Popout */} {/* End of Job List Popout */}
{/* Delete Job Popout */}
{deleteJobPopout.show &&
<DeleteJobPopout details={deleteJobPopout.data} onClose={()=>{setDeleteJobPopout({show:false, data:{}})}} situation={deleteJobPopout.show} />
}
{/* END of Delete Job Popout */}
</div> </div>
); );
} }
@@ -0,0 +1,112 @@
import React, { useState } from "react";
import dataImage1 from "../../assets/images/data-table-user-1.png";
import dataImage2 from "../../assets/images/data-table-user-2.png";
import dataImage3 from "../../assets/images/data-table-user-3.png";
import dataImage4 from "../../assets/images/data-table-user-4.png";
import SelectBox from "../Helpers/SelectBox";
import ActiveJobsPopout from "../jobPopout/ActiveJobsPopout";
import PaginatedList from "../Pagination/PaginatedList";
import { handlePagingFunc } from "../Pagination/HandlePagination";
export default function MyPendingJobTable({MyJobList, className }) {
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
let [jobPopout,setJobPopout] = useState({show:false, data:{}}) // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentActiveJobList = MyJobList?.result_list?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e,setCurrentPage)
}
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className || ""
}`}
>
{MyJobList && MyJobList?.result_list &&
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody>
{/*<tr className="text-base text-thin-light-gray border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">*/}
{/* <td className="py-4">All Product</td>*/}
{/* <td className="py-4 text-right">.</td>*/}
{/*</tr>*/}
{
<>
{MyJobList && MyJobList?.result_list &&
MyJobList.result_list.length > 0 &&
currentActiveJobList.map((value, index) => (
<tr key={index} className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
<td className=" py-4">
<div className="flex space-x-2 items-center">
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>
{value.description}
</div>
<span className="text-sm text-thin-light-gray">
Price: <span className="text-purple">{value.price*0.01}</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration: <span className="text-purple"> {value.timeline_days} day(s)</span>
</span>
<span className="text-sm text-thin-light-gray">
Expire: <span className="text-purple"> {value.expire}</span>
</span>
<span className="text-sm text-thin-light-gray">
Send to: <span className="text-purple"> {value.job_to}</span>
</span>
</div>
</div>
</td>
<td className="text-right py-4 px-2">
<button
type="button"
onClick={()=>{setJobPopout({show:true, data:value})}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</td>
</tr>
))}
</>
}
</tbody>
</table>
{/* PAGINATION BUTTON */}
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= MyJobList?.result_list.length ? true : false} data={MyJobList?.result_list} start={indexOfFirstItem} stop={indexOfLastItem} />
{/* END OF PAGINATION BUTTON */}
</div>
}
{/* Active Job Popout */}
{jobPopout.show &&
<ActiveJobsPopout details={jobPopout.data} onClose={()=>{setJobPopout({show:false, data:{}})}} situation={jobPopout.show} />
}
{/* End of Active Job Popout */}
</div>
);
}
+41
View File
@@ -0,0 +1,41 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import Layout from "../Partials/Layout";
import CommonHead from "../UserHeader/CommonHead";
import MyPendingJobTable from "./MyPendingJobTable";
export default function MyPendingJobs(props) {
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
console.log("AMEYE LOC1", props.MyJobList);
return (
<Layout>
<CommonHead />
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Pending Job(s)
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div onClick={() => filterHandler("today")} className="relative">
</div>
</div>
</div>
<MyPendingJobTable MyJobList={props.MyJobList} />
</div>
</div>
</Layout>
);
}
+2 -2
View File
@@ -25,12 +25,12 @@ function Balance({wallet, coupon}) {
<div key={index} className="md:flex items-center flex-wrap my-3 border-t-2 border-slate-400"> <div key={index} className="md:flex items-center flex-wrap my-3 border-t-2 border-slate-400">
<div className='text-slate-900 w-full md:w-1/2 flex space-x-3 items-start justify-start'> <div className='text-slate-900 w-full md:w-1/2 flex space-x-3 items-start justify-start'>
<div className='balance-info'> <div className='balance-info'>
<p className='py-2'>Currency</p> <p className='py-2'></p>
<span className='text-base'>{item.description}</span> <span className='text-base'>{item.description}</span>
<p className='text-base text-slate-500'>{item.symbol}</p> <p className='text-base text-slate-500'>{item.symbol}</p>
</div> </div>
<div className='balance-info'> <div className='balance-info'>
<p className='py-2'>balance</p> <p className='py-2'>Balance</p>
<span className='text-sm py-1 px-2 bg-green-100 text-green-500 rounded-lg'>{item.symbol}{(item.amount*0.01).toFixed(2)}</span> <span className='text-sm py-1 px-2 bg-green-100 text-green-500 rounded-lg'>{item.symbol}{(item.amount*0.01).toFixed(2)}</span>
</div> </div>
<div className='balance-info'> <div className='balance-info'>
+62 -53
View File
@@ -110,6 +110,7 @@ function TransferFund({ payment, wallet }) {
useEffect(() => { useEffect(() => {
getRecipients(); getRecipients();
}, []); }, []);
return ( return (
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin"> <div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-1/2 w-full mb-10 lg:mb-0"> <div className="lg:w-1/2 w-full mb-10 lg:mb-0">
@@ -136,21 +137,25 @@ function TransferFund({ payment, wallet }) {
</h2> </h2>
) : wallet.error ? ( ) : wallet.error ? (
<h2 className="my-4 py-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium"> <h2 className="my-4 py-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Opps! An Error Occured Opps! An Error Occurred
</h2> </h2>
) : ( ) : (
<h2 className="my-4 py-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium"> <h2 className="my-4 py-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
No Wallet Information Found! No Wallet Information Found!
</h2> </h2>
)} )}
<div className="xl:flex xl:space-x-7 mb-6"> <div className=" mb-6 gap-4 flex flex-col">
<div className="field w-full mb-6 xl:mb-0"> <div className="field w-full">
<InputCom <InputCom
fieldClass="px-6" fieldClass="px-4"
label="Amount" parentClass="flex items-center gap-1 justify-between"
type="text" labelClass="flex-[0.2] mb-0"
inputClass="flex-[0.8] max-w-[12rem]"
label="Amount:"
type="number"
name="amount" name="amount"
placeholder="0" placeholder="0"
direction="rtl"
value={props.values.amount} value={props.values.amount}
inputHandler={props.handleChange} inputHandler={props.handleChange}
blurHandler={(e) => { blurHandler={(e) => {
@@ -160,7 +165,7 @@ function TransferFund({ payment, wallet }) {
// onMouseLeave={(e)=>{getSendMoneyFee(e)}} // onMouseLeave={(e)=>{getSendMoneyFee(e)}}
/> />
{props.errors.amount && props.touched.amount && ( {props.errors.amount && props.touched.amount && (
<p className="text-sm text-red-500"> <p className="sm:text-sm text-[12px] text-red-500 sm:text-left text-right sm:translate-y-0 translate-y-1">
{props.errors.amount} {props.errors.amount}
</p> </p>
)} )}
@@ -168,25 +173,31 @@ function TransferFund({ payment, wallet }) {
<div className="field w-full"> <div className="field w-full">
<InputCom <InputCom
fieldClass="px-6" fieldClass="px-4 transfer-field"
label="Fee" parentClass="flex items-center gap-1 justify-between"
labelClass="flex-[0.2] mb-0"
inputClass="flex-[0.8] transfer-field max-w-[12rem]"
label="Fee:"
type="text" type="text"
name="fee" name="fee"
direction="rtl"
value={ value={
sendMoneyFee.loading ? "loading" : sendMoneyFee.fee sendMoneyFee.loading ? "loading" : sendMoneyFee.fee
} }
disable={true} disable={true}
/> />
</div> </div>
</div>
<div className="md:flex items-center justify-end"> <div className="field w-full mb-6">
<div className="field w-full lg:w-1/2 mb-6">
<InputCom <InputCom
fieldClass="px-6" fieldClass="px-4 transfer-field"
label="Total" parentClass="flex items-center gap-1 justify-between"
labelClass="flex-[0.2] mb-0"
inputClass="flex-[0.8] transfer-field max-w-[12rem]"
label="Total:"
type="text" type="text"
name="total" name="total"
direction="rtl"
value={ value={
sendMoneyFee.loading ? "loading" : sendMoneyFee.total sendMoneyFee.loading ? "loading" : sendMoneyFee.total
} }
@@ -197,34 +208,23 @@ function TransferFund({ payment, wallet }) {
<div className="w-full"> <div className="w-full">
<div className="relative my-3 md:flex items-center"> <div className="relative my-3 md:flex items-center">
<div className="transfer-input w-full"> <div className="transfer-input w-full flex items-start gap-1 justify-between">
<div className="flex items-center justify-start py-2"> <label className="text-[#181c32] dark:text-white text-base font-semibold block flex-[0.2] mb-0 mt-3">
<label className="text-[#181c32] dark:text-white text-base font-semibold block mb-2.5"> Recipient:
Recipient
<span className="text-red-500 mx-2">*</span>
<span
title="Transfer Recipient"
className={`text-white text-sm bg-slate-500 w-1 h-1 rounded-full px-3 py-1 cursor-pointer`}
>
!
</span>
</label> </label>
<Link <div className="flex flex-col gap-3 flex-[0.8] sm:items-start items-end">
to="add-recipient"
className="mx-1 text-base text-white p-2 bg-[orange] rounded-md hover:opacity-80"
>
Add New
</Link>
</div>
<select <select
className="w-full text-base p-2 text-dark-gray dark:text-white rounded-md border border-slate-300 outline-0" className="sm:w-full w-48 text-base p-2 text-dark-gray dark:text-white rounded-md border border-slate-300 outline-0 flex-[0.8]"
value={props.values.recipientID} value={props.values.recipientID}
name="recipientID" name="recipientID"
onChange={props.handleChange} onChange={props.handleChange}
onBlur={props.handleBlur} onBlur={props.handleBlur}
> >
{recipients.loading ? ( {recipients.loading ? (
<option className="text-slate-500 text-lg" value=""> <option
className="text-slate-500 text-lg"
value=""
>
Loading... Loading...
</option> </option>
) : recipients.data.length ? ( ) : recipients.data.length ? (
@@ -246,38 +246,47 @@ function TransferFund({ payment, wallet }) {
))} ))}
</> </>
) : recipients.error ? ( ) : recipients.error ? (
<option className="text-slate-500 text-lg" value=""> <option
Could'nt Load, try again! className="text-slate-500 text-lg"
value=""
>
Could'nt load, try again!
</option> </option>
) : ( ) : (
<option className="text-slate-500 text-lg" value=""> <option
No Recipient Found! Click Add to Add className="text-slate-500 text-lg"
value=""
>
No Recipient Found!
</option> </option>
)} )}
</select> </select>
</div> <div className="flex justify-end relative w-full">
</div> {props.errors.recipientID &&
{props.errors.recipientID && props.touched.recipientID && ( props.touched.recipientID && (
<p className="text-sm text-red-500"> <p className="sm:text-sm text-[12px] text-red-500 absolute sm:top-1 -top-20 sm:left-0 left-[160px]">
{props.errors.recipientID} {props.errors.recipientID}
</p> </p>
)} )}
<Link
to="add-recipient"
className="mx-1 text-base text-white p-2 bg-[orange] rounded-md hover:opacity-80 max-w-[5rem]"
>
Add New
</Link>
</div>
</div>
</div>
</div>
</div> </div>
<div className="field w-full mb-6"> <div className="field w-full mb-6 flex gap-1 justify-between">
{/* <InputCom fieldClass="px-6" <label className="text-[#181c32] dark:text-white text-base font-semibold flex flex-[0.2] mt-2.5">
label="Comment" Comment:
type="text"
name="comment"
value={inputs.comment}
inputHandler={handleChange}
/> */}
<label className="text-[#181c32] dark:text-white text-base font-semibold block mb-2.5">
Comment
</label> </label>
<textarea <textarea
style={{ resize: "none" }} style={{ resize: "none" }}
className="text-base px-6 text-dark-gray dark:text-white w-full bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none" className="text-base px-4 py-2 rounded-md min-h-[100px] sm:max-w-[550px] max-w-[250px] text-dark-gray dark:text-white w-full bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none flex-[0.8]"
name="comment" name="comment"
value={props.values.comment} value={props.values.comment}
onChange={props.handleChange} onChange={props.handleChange}
+5 -25
View File
@@ -1,17 +1,4 @@
import React, { useState } from "react"; import React, { useState } from "react";
import topCreator1 from "../../assets/images/top-creator-1.png";
import topCreator2 from "../../assets/images/top-creator-2.png";
import topCreator3 from "../../assets/images/top-creator-3.png";
import topCreator4 from "../../assets/images/top-creator-4.png";
import topCreator5 from "../../assets/images/top-creator-5.png";
import DoughnutChart from "../Charts/DoughnutChart";
import MiniLineChart from "../Charts/MiniLineChart";
import Icons from "../Helpers/Icons";
import BtcIco from "../Helpers/Icons/BtcIco";
import EthIco from "../Helpers/Icons/EthIco";
import LtcIco from "../Helpers/Icons/LtcIco";
import Usdt from "../Helpers/Icons/Usdt";
import SelectBox from "../Helpers/SelectBox";
import { NavLink } from "react-router-dom"; import { NavLink } from "react-router-dom";
//import SideStatistics from "./SideStatistics"; //import SideStatistics from "./SideStatistics";
@@ -42,6 +29,7 @@ export default function RightSideBar() {
} }
setRateStaticsDropdown(!filterRateStatics); setRateStaticsDropdown(!filterRateStatics);
}; };
return ( return (
<> <>
<div className="right-sidebar-wrapper overflow-y-scroll overflow-style-none 2xl:fixed 2xl:grid-cols-none 2xl:block grid lg:grid-cols-2 grid-cols-1 xl:gap-7 gap-4 h-full 2xl:pb-96"> <div className="right-sidebar-wrapper overflow-y-scroll overflow-style-none 2xl:fixed 2xl:grid-cols-none 2xl:block grid lg:grid-cols-2 grid-cols-1 xl:gap-7 gap-4 h-full 2xl:pb-96">
@@ -51,8 +39,7 @@ export default function RightSideBar() {
<h3 className="text-xl font-bold text-dark-gray dark:text-white"> <h3 className="text-xl font-bold text-dark-gray dark:text-white">
Quick Links Quick Links
</h3> </h3>
<div> <div></div>
</div>
</div> </div>
<div className="platform-list"> <div className="platform-list">
@@ -110,10 +97,7 @@ export default function RightSideBar() {
{/* name */} {/* name */}
<div> <div>
<p className="text-thin-light-gray text-base font-medium"> <p className="text-thin-light-gray text-base font-medium">
<NavLink <NavLink to="/history">History</NavLink>
to="/history">
History
</NavLink>
</p> </p>
</div> </div>
{/* action */} {/* action */}
@@ -157,8 +141,7 @@ export default function RightSideBar() {
{/* name */} {/* name */}
<div> <div>
<p className="text-thin-light-gray text-base font-medium"> <p className="text-thin-light-gray text-base font-medium">
<NavLink <NavLink to="/referral">Refer a Friend</NavLink>
to="/referral">Refer a Friend</NavLink>
</p> </p>
</div> </div>
</div> </div>
@@ -192,10 +175,7 @@ export default function RightSideBar() {
{/* name */} {/* name */}
<div> <div>
<p className="text-thin-light-gray text-base font-medium"> <p className="text-thin-light-gray text-base font-medium">
<NavLink <NavLink to="/resources">Resources</NavLink>
to="/resources">
Resources
</NavLink>
</p> </p>
</div> </div>
</div> </div>
+1 -1
View File
@@ -279,7 +279,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
</li> </li>
<li className="item group"> <li className="item group">
<NavLink <NavLink
to="/my-active-jobs" to="/my-pending-jobs"
className={`nav-item flex items-center ${ className={`nav-item flex items-center ${
((navData) => (navData.isActive ? "active" : ""), ((navData) => (navData.isActive ? "active" : ""),
sidebar ? "justify-start space-x-3.5" : "justify-center") sidebar ? "justify-start space-x-3.5" : "justify-center")
@@ -0,0 +1,149 @@
import React, { useState } from 'react'
import ModalCom from '../Helpers/ModalCom'
import { useNavigate } from 'react-router-dom'
import usersService from '../../services/UsersService'
import LoadingSpinner from '../Spinners/LoadingSpinner'
function DeleteJobPopout({details, onClose, situation}) {
const navigate = useNavigate()
const ApiCall = new usersService()
let [requestStatus, setRequestStatus] = useState({laoding: false, status:false, message: ''}) // STATE FOR KNOWING WHEN A REQUEST IS MADE TO THE SERVER
// FUNCTION CALLED ONCE USER CONFIRM DELETE JOB
const deleteJob = (details) => {
setRequestStatus({laoding: true, status:false, message: ''})
let reqData = {
job_id: details.job_id,
job_uid: details.job_uid
} // DATA NEEDED BY THE API
// API CALL TO DELETE A JOB
ApiCall.deleteJob(reqData).then(res => {
if(res.data.internal_return < 0){
setRequestStatus({laoding: false, status:false, message: 'Could not perform the request, try again!'})
return
}
setRequestStatus({laoding: false, status:true, message: 'Job deleted successfully'})
setTimeout(()=>{
navigate('/myjobs', {replace: true})
onClose()
window.location.reload()
}, 1000)
}).catch(error => {
setRequestStatus({laoding: false, status:false, message: 'Opps! something went wrong, try again'})
}).finally(()=>{
setTimeout(()=>{
setRequestStatus({laoding: false, status:false, message: ''})
}, 5000)
})
}
return (
<ModalCom action={onClose} situation={situation}>
<div className="logout-modal-wrapper lg:w-[600px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Delete Job
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
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="logout-modal-body w-full flex flex-col items-center px-10 py-8">
<div className="what-icon mb-6 cursor-pointer">
<svg
width="136"
height="136"
viewBox="0 0 136 136"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="68" cy="68" r="68" fill="#5356FB" />
<path
d="M69.8844 35.7891C71.1588 36.0357 72.4569 36.1967 73.7044 36.5423C81.5447 38.7098 87.2705 45.5378 87.9574 53.6156C88.5113 60.1147 86.3075 65.6006 81.5043 70.0195C79.8359 71.5545 78.0497 72.9604 76.3408 74.4534C76.127 74.6397 75.9654 75.0037 75.9604 75.2872C75.9284 77.2752 75.9435 79.2649 75.9435 81.2965C70.8895 81.2965 65.8758 81.2965 60.7915 81.2965C60.7915 81.0616 60.7915 80.8385 60.7915 80.6137C60.7915 76.5454 60.7999 72.4772 60.7797 68.4106C60.778 67.9392 60.9312 67.649 61.2831 67.3537C64.5643 64.5957 67.8271 61.8175 71.1033 59.0545C72.2616 58.0781 72.9215 56.8702 72.9081 55.3419C72.8878 52.916 70.8608 50.9146 68.423 50.8911C65.9701 50.8693 63.9145 52.8053 63.832 55.2328C63.8084 55.8988 63.8286 56.5665 63.8286 57.2695C58.7745 57.2695 53.7744 57.2695 48.6917 57.2695C48.6917 56.3149 48.6462 55.3385 48.6984 54.3655C49.222 44.699 56.7442 36.8745 66.4331 35.8914C66.5762 35.8763 66.7142 35.8243 66.854 35.7891C67.8641 35.7891 68.8742 35.7891 69.8844 35.7891Z"
fill="white"
/>
<path
d="M67.485 100.21C66.1617 99.9268 64.9041 99.5091 63.803 98.6787C61.3804 96.8484 60.2877 93.7699 61.0386 90.7888C61.7726 87.8747 64.2138 85.6703 67.2089 85.2157C71.273 84.6 75.2024 87.3681 75.8135 91.277C76.4937 95.6153 73.8202 99.3782 69.544 100.103C69.4429 100.12 69.3487 100.172 69.2527 100.209C68.6635 100.21 68.0742 100.21 67.485 100.21Z"
fill="white"
/>
</svg>
</div>
<div className="mb-6">
<p className="text-xl tracking-wide text-dark-gray dark:text-white">
{details.title}
</p>
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
Price: {details.price}
</p>
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
Duration: {details.timeline_days} day(s)
</p>
</div>
<div className="flex space-x-2.5">
<button
onClick={onClose}
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={() => deleteJob(details)}
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 */}
{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>
</ModalCom>
)
}
export default DeleteJobPopout
+12
View File
@@ -105,6 +105,11 @@ input::-webkit-inner-spin-button {
input[type="number"] { input[type="number"] {
-moz-appearance: textfield; -moz-appearance: textfield;
} }
input[type="text"][dir="rtl"] {
text-align: right;
}
.default-border-bottom { .default-border-bottom {
border-bottom: 1px solid #d3d2fe; border-bottom: 1px solid #d3d2fe;
} }
@@ -364,6 +369,13 @@ input[type="number"] {
margin: 0 16px; margin: 0 16px;
} }
.transfer-field, .transfer-field:focus, .transfer-field:focus-within{
background: #FFF !important;
border: none !important;
outline: none !important;
box-shadow: none !important;
}
/* the parent */ /* the parent */
.trending-products .slick-list { .trending-products .slick-list {
margin: 0 -16px; margin: 0 -16px;
+35 -12
View File
@@ -107,17 +107,17 @@ class usersService {
/* /*
getMyActiveJobList - List of jobs active under this user getMyActiveJobList - List of jobs active under this user
*/ */
getMyActiveJobList(){ // getMyActiveJobList(){
var postData = { // var postData = {
uuid: localStorage.getItem("uid"), // uuid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"), // member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"), // sessionid: localStorage.getItem("session_token"),
page:0, // page:0,
offset:0, // offset:0,
limit :100 // limit :100
}; // };
return this.postAuxEnd("/getjobsdata", postData); // return this.postAuxEnd("/getjobsdata", postData);
} // }
getHeroJBanners(){ getHeroJBanners(){
var postData = { var postData = {
uuid: localStorage.getItem("uid"), uuid: localStorage.getItem("uid"),
@@ -207,9 +207,20 @@ class usersService {
offset:0, offset:0,
limit :100 limit :100
}; };
return this.postAuxEnd("/jobmanageroffers", postData); return this.postAuxEnd("/jobmanageractive", postData);
} }
getMyPendingJobList(){
var postData = {
uuid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
page:0,
offset:0,
limit :100
};
return this.postAuxEnd("/jobmanageroffers", postData);
}
getMyJobList(){ getMyJobList(){
var postData = { var postData = {
uuid: localStorage.getItem("uid"), uuid: localStorage.getItem("uid"),
@@ -438,6 +449,18 @@ class usersService {
return this.postAuxEnd("/jobmanagercreatejob", postData); return this.postAuxEnd("/jobmanagercreatejob", postData);
} }
// END POINT TO DELETE A JOB
deleteJob(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 13011,
...reqData
};
return this.postAuxEnd("/jobmanagerdeletejob", postData);
}
verifyEmail(code) { verifyEmail(code) {
const reqData = { const reqData = {
verify_link: code, verify_link: code,
+1 -1
View File
@@ -7,7 +7,7 @@ export default function MyActiveJobsPage() {
const [MyJobList, setMyJobList] = useState([]); const [MyJobList, setMyJobList] = useState([]);
const api = new usersService(); const api = new usersService();
//TARGET ENDPOINT[POST]http://10.204.5.100:9083/en/wrench/api/v1/jobmanageractive
const getMyJobList = async () => { const getMyJobList = async () => {
try { try {
const res = await api.getMyActiveJobList(); const res = await api.getMyActiveJobList();
+30
View File
@@ -0,0 +1,30 @@
import React, { useContext,useState, useEffect } from "react";
import usersService from "../services/UsersService";
//import MyJobs from "../components/MyJobs";
import MyActiveJobs from "../components/MyActiveJobs";
import MyPendingJobs from "../components/MyPendingJobs";
export default function MyPendingJobsPage() {
const [MyJobList, setMyJobList] = useState([]);
const api = new usersService();
const getMyJobList = async () => {
try {
const res = await api.getMyPendingJobList();
setMyJobList(res.data);
} catch (error) {
console.log("Error getting mode");
}
};
useEffect(() => {
getMyJobList();
}, []);
// debugger;
return (
<>
<MyPendingJobs MyJobList={MyJobList} />
</>
);
}