Compare commits

...

21 Commits

Author SHA1 Message Date
victorAnumudu 7e7176ae5c server icon fix 2023-11-11 07:03:54 +01:00
victorAnumudu 306fa1300d replaced images to server images on mytask route 2023-11-11 06:26:00 +01:00
ameye 7b3178bd1a Merge branch 'add-family-btn-bug' of WrenchBoard/Users-Wrench into master 2023-11-10 17:50:11 +00:00
victorAnumudu 5e94ddee48 fixed add family btn 2023-11-09 07:09:24 +01:00
ameye 32171ae3ce Merge branch 'Server-path-added' of WrenchBoard/Users-Wrench into master 2023-11-08 19:47:53 +00:00
Chief Bube 2c99fedd8c removing session once user logs out or session expires 2023-11-08 10:58:42 -08:00
Chief Bube 7e926cc7bc added family image 2023-11-08 10:42:54 -08:00
ameye 587bcaa411 Merge branch 'family-wallet-copy' of WrenchBoard/Users-Wrench into master 2023-11-08 17:56:42 +00:00
ameye 756628ee1a Merge branch 'image-bug' of WrenchBoard/Users-Wrench into master 2023-11-08 17:56:37 +00:00
victorAnumudu 575710a807 image bug fixed 2023-11-08 18:26:50 +01:00
victorAnumudu c77d8e5693 merged from master branch 2023-11-08 18:18:06 +01:00
victorAnumudu 7e9d734e6f added copy wallet for family member 2023-11-08 18:15:21 +01:00
ameye 9ddb127bd3 Merge branch 'job-image-icon' of WrenchBoard/Users-Wrench into master 2023-11-08 16:24:00 +00:00
victorAnumudu a85e5fdb91 changed default icons to server icons 2023-11-08 09:41:06 +01:00
victorAnumudu 09ad8a94ca changed default icons to server icons 2023-11-08 09:39:28 +01:00
Chief Bube 0c1db6b4b5 fixed svg typos 2023-11-07 23:00:12 -08:00
ameye 6ddffdf2e6 Merge branch 'Server-path-added' of WrenchBoard/Users-Wrench into master 2023-11-08 04:29:31 +00:00
Chief Bube 5043540abb Added conditionals to the paths to avoid breakage and resolved some images in family account 2023-11-07 09:24:28 -08:00
ameye 5f39accdd6 Merge branch 'pend-interest' of WrenchBoard/Users-Wrench into master 2023-11-07 16:20:23 +00:00
victorAnumudu b5aeaf59a4 changed from offer_uid to job_uid 2023-11-07 17:13:50 +01:00
ameye f3e63d2ef6 Merge branch 'default-icon' of WrenchBoard/Users-Wrench into master 2023-11-07 13:52:19 +00:00
34 changed files with 292 additions and 141 deletions
+2 -2
View File
@@ -167,7 +167,7 @@ function AddJob({ popUpHandler, categories }) {
onChange={props.handleChange} onChange={props.handleChange}
onBlur={props.handleBlur} onBlur={props.handleBlur}
> >
{walletDetails.loading ? ( {walletDetails?.loading ? (
<option className="text-slate-500 text-lg" value=""> <option className="text-slate-500 text-lg" value="">
Loading... Loading...
</option> </option>
@@ -400,7 +400,7 @@ function AddJob({ popUpHandler, categories }) {
</span> </span>
</button> </button>
{requestStatus.loading ? ( {requestStatus?.loading ? (
<LoadingSpinner size="8" color="sky-blue" /> <LoadingSpinner size="8" color="sky-blue" />
) : ( ) : (
<button <button
+48 -39
View File
@@ -17,14 +17,14 @@ import { updateUserDetails } from "../../../store/UserDetails";
import ReCAPTCHA from "react-google-recaptcha"; import ReCAPTCHA from "react-google-recaptcha";
export default function Login() { export default function Login() {
// eslint-disable-next-line no-restricted-globals
const queryParams = new URLSearchParams(location?.search); const queryParams = new URLSearchParams(location?.search);
const sessionExpired = queryParams.get("sessionExpired") const sessionExpired = queryParams.get("sessionExpired");
const dispatch = useDispatch(); const dispatch = useDispatch();
const { state } = useLocation(); const { state } = useLocation();
const [validCaptcha, setValidCaptcha] = useState({show: false, valid:''}); // FOR CAPTCHA const [validCaptcha, setValidCaptcha] = useState({ show: false, valid: "" }); // FOR CAPTCHA
let [loginType, setLoginType] = useState(""); let [loginType, setLoginType] = useState("");
@@ -115,7 +115,8 @@ export default function Login() {
}, Number(process.env.REACT_APP_LOGIN_ERROR_TIMEOUT)); }, Number(process.env.REACT_APP_LOGIN_ERROR_TIMEOUT));
return; return;
} }
if(name == "full" && !validCaptcha.valid && validCaptcha.show){ // RUNS AND DISPLAYS CAPTCHA, IF ERROR OCCURED DURING LOGIN FOR FULL LOGIN ALONE if (name == "full" && !validCaptcha.valid && validCaptcha.show) {
// RUNS AND DISPLAYS CAPTCHA, IF ERROR OCCURED DURING LOGIN FOR FULL LOGIN ALONE
setMsgError("Please Verify Captcha"); setMsgError("Please Verify Captcha");
setLoginLoading(false); setLoginLoading(false);
setTimeout(() => { setTimeout(() => {
@@ -136,12 +137,15 @@ export default function Login() {
// setMsgError("Wrong, email/password"); // setMsgError("Wrong, email/password");
setLoginError(true); setLoginError(true);
setLoginLoading(false); setLoginLoading(false);
setValidCaptcha(prev => ({...prev, show:true})) // DISPLAYS CAPTCHA IF ERROR setValidCaptcha((prev) => ({ ...prev, show: true })); // DISPLAYS CAPTCHA IF ERROR
return; return;
} }
localStorage.setItem("member_id", `${res.data.member_id}`); localStorage.setItem("member_id", `${res.data.member_id}`);
localStorage.setItem("uid", `${res.data.uid}`); localStorage.setItem("uid", `${res.data.uid}`);
localStorage.setItem("session_token", `${res.data.session}`); localStorage.setItem("session_token", `${res.data.session}`);
if (name === "family") {
sessionStorage.setItem("family_uid", res.data?.family_uid);
}
// localStorage.setItem("session", `${res.data.session}`); // localStorage.setItem("session", `${res.data.session}`);
dispatch(updateUserDetails({ ...res.data })); dispatch(updateUserDetails({ ...res.data }));
setTimeout(() => { setTimeout(() => {
@@ -152,7 +156,7 @@ export default function Login() {
.catch((error) => { .catch((error) => {
setMsgError("Unable to login, try again"); setMsgError("Unable to login, try again");
setLoginLoading(false); setLoginLoading(false);
setValidCaptcha(prev => ({...prev, show:true})) // DISPLAYS CAPTCHA IF ERROR setValidCaptcha((prev) => ({ ...prev, show: true })); // DISPLAYS CAPTCHA IF ERROR
}) })
.finally(() => { .finally(() => {
setTimeout(() => { setTimeout(() => {
@@ -163,11 +167,12 @@ export default function Login() {
}); });
}; };
function captchaChecker(value) { // FUNCTION TO VALIDATE CAPTCHA function captchaChecker(value) {
if(value){ // FUNCTION TO VALIDATE CAPTCHA
setValidCaptcha({show: true, valid:value}) if (value) {
}else{ setValidCaptcha({ show: true, valid: value });
setValidCaptcha({show: true, valid:''}) } else {
setValidCaptcha({ show: true, valid: "" });
} }
} }
@@ -245,31 +250,32 @@ export default function Login() {
</div> </div>
<div className="content-wrapper login shadow-md w-full lg:max-w-[530px] 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-full lg:max-w-[530px] 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="w-full"> <div className="w-full">
{/* 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">
{/* <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]">
Sign In to WrenchBoard Sign In to WrenchBoard
</h1> */} </h1> */}
<span className="text-gray-400 font-medium text-[16.25px] leading-[24.375px]"> <span className="text-gray-400 font-medium text-[16.25px] leading-[24.375px]">
New Here?{" "} New Here?{" "}
<Link <Link
to="/signup" to="/signup"
className="font-semibold text-[#4687ba] hover:text-[#009ef7] transition" className="font-semibold text-[#4687ba] hover:text-[#009ef7] transition"
> >
Create an Account Create an Account
</Link> </Link>
</span> </span>
</div> </div>
} )}
{/* SHOWS THIS IF USER SESSION HAS EXPIRED */} {/* SHOWS THIS IF USER SESSION HAS EXPIRED */}
{sessionExpired == 'true' && {sessionExpired == "true" && (
<div className="w-full p-1 mb-7"> <div className="w-full p-1 mb-7">
<p className="text-red-500 text-base text-center">Your session expired and will need to login again</p> <p className="text-red-500 text-base text-center">
</div> Your session expired and will need to login again
} </p>
</div>
)}
{/* switch login component */} {/* switch login component */}
<div className="ml-7 flex justify-start items-center gap-3"> <div className="ml-7 flex justify-start items-center gap-3">
@@ -335,14 +341,16 @@ export default function Login() {
</div> </div>
{/* hCaptha clone for the time being */} {/* hCaptha clone for the time being */}
{validCaptcha.show && {validCaptcha.show && (
<div className="mb-5 flex justify-center w-full"> <div className="mb-5 flex justify-center w-full">
<ReCAPTCHA <ReCAPTCHA
sitekey={process.env.REACT_APP_GOOGLE_RECAPTCHA_SITEKEY} sitekey={
onChange={captchaChecker} process.env.REACT_APP_GOOGLE_RECAPTCHA_SITEKEY
}
onChange={captchaChecker}
/> />
</div> </div>
} )}
{loginError && ( {loginError && (
<div className="relative p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-thin leading-[19.5px] text-[13px]"> <div className="relative p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-thin leading-[19.5px] text-[13px]">
@@ -499,7 +507,8 @@ export default function Login() {
{loginType == "full" && ( {loginType == "full" && (
<div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]"> <div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
This site is protected by a Captcha. Our Privacy Policy and Terms of Service apply. This site is protected by a Captcha. Our Privacy Policy and
Terms of Service apply.
</div> </div>
)} )}
</div> </div>
+1 -1
View File
@@ -47,7 +47,7 @@ export default function BlogItem(props) {
</h1> </h1>
</div> </div>
<div className="notification-wrapper w-full bg-white p-8 rounded-2xl"> <div className="notification-wrapper w-full bg-white p-8 rounded-2xl">
{blogdata.loading ? {blogdata?.loading ?
<LoadingSpinner size='8' color='sky-blue' height='h-[100px]' /> <LoadingSpinner size='8' color='sky-blue' height='h-[100px]' />
: :
blogdata?.data?.blogdata && blogdata.data?.blogdata.length ? blogdata?.data?.blogdata && blogdata.data?.blogdata.length ?
+5 -3
View File
@@ -24,9 +24,11 @@ export default function AvailableJobsCard({
setImageUrl(imagePath); setImageUrl(imagePath);
}, []); }, []);
const image = `${image_server}${localStorage.getItem( const image = localStorage.getItem("session_token")
"session_token" ? `${image_server}${localStorage.getItem("session_token")}/job/${
)}/job/${datas.job_uid}`; datas.job_uid
}`
: "";
return ( return (
<> <>
@@ -5,7 +5,7 @@ import localImgLoad from "../../lib/localImgLoad";
import CountDown from "../Helpers/CountDown"; import CountDown from "../Helpers/CountDown";
import Icons from "../Helpers/Icons"; import Icons from "../Helpers/Icons";
export default function FamilyActiveJobsCard({ datas, hidden = false }) { export default function FamilyActiveJobsCard({ datas, hidden = false, image_server }) {
let { pathname } = useLocation(); let { pathname } = useLocation();
@@ -22,7 +22,8 @@ export default function FamilyActiveJobsCard({ datas, hidden = false }) {
} }
}; };
//debugger; //debugger;
const bannerName = datas.banner == null ?'default.jpg':datas.banner; // const bannerName = datas.banner == null ?'default.jpg':datas.banner;
let image = `${image_server}${localStorage.getItem('session_token')}/job/${datas.origin_job_uid}`
return ( return (
<div className="card-style-one flex flex-col justify-between w-full h-[387px] bg-white dark:bg-dark-white p-3 pb rounded-2xl"> <div className="card-style-one flex flex-col justify-between w-full h-[387px] bg-white dark:bg-dark-white p-3 pb rounded-2xl">
<div className="content"> <div className="content">
@@ -31,10 +32,13 @@ export default function FamilyActiveJobsCard({ datas, hidden = false }) {
{/* thumbnail image */} {/* thumbnail image */}
<div <div
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4" className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
// style={{
// background: `url(${localImgLoad(
// `images/taskbanners/${bannerName}`
// )}) center / contain no-repeat`,
// }}
style={{ style={{
background: `url(${localImgLoad( background: `url(${image}) center / contain no-repeat`,
`images/taskbanners/${bannerName}`
)}) center / contain no-repeat`,
}} }}
> >
{/* <div className="product-options flex justify-between relative">*/} {/* <div className="product-options flex justify-between relative">*/}
+11 -25
View File
@@ -2,13 +2,20 @@ import localImgLoad from "../../lib/localImgLoad";
import CountDown from "../Helpers/CountDown"; import CountDown from "../Helpers/CountDown";
import { PriceFormatter } from "../Helpers/PriceFormatter"; import { PriceFormatter } from "../Helpers/PriceFormatter";
export default function OfferCard({ datas, hidden = false, setOfferPopout }) { export default function OfferCard({
datas,
hidden = false,
setOfferPopout,
image_server,
}) {
let thePrice = PriceFormatter( let thePrice = PriceFormatter(
datas?.price * 0.01, datas?.price * 0.01,
datas?.currency_code, datas?.currency_code,
datas?.currency datas?.currency
); );
let image = `${image_server}${localStorage.getItem("session_token")}/job/${datas.job_uid}`
return ( return (
<div className="card-style-one flex flex-col justify-between w-full h-[387px] bg-white dark:bg-dark-white p-3 pb rounded-2xl"> <div className="card-style-one flex flex-col justify-between w-full h-[387px] bg-white dark:bg-dark-white p-3 pb rounded-2xl">
<div className="content"> <div className="content">
@@ -18,9 +25,7 @@ export default function OfferCard({ datas, hidden = false, setOfferPopout }) {
<div <div
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4" className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
style={{ style={{
background: `url(${localImgLoad( background: `url(${image}) center / contain no-repeat`,
`images/taskbanners/${datas?.banner || "default.jpg"}`
)}) center / contain no-repeat`,
}} }}
> >
{hidden && <div className="flex justify-center"></div>} {hidden && <div className="flex justify-center"></div>}
@@ -31,26 +36,7 @@ export default function OfferCard({ datas, hidden = false, setOfferPopout }) {
<h1 className="text-xl font-bold text-dark-gray dark:text-white mb-2 capitalize line-clamp-1"> <h1 className="text-xl font-bold text-dark-gray dark:text-white mb-2 capitalize line-clamp-1">
{datas.title} {datas.title}
</h1> </h1>
{/* countdown */}
{/* <div className="w-full h-[54px] flex justify-evenly items-center p-2 rounded-lg border border-[#E3E4FE] dark:border-[#a7a9b533] ">
<div className="flex flex-col justify-between">
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
Task Code
</p>
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
{datas.contract}
</p>
</div>
<div className="w-[1px] h-full bg-[#E3E4FE] dark:bg-[#a7a9b533] "></div>
<div className="flex flex-col justify-between">
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
Remaining Time
</p>
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
<CountDown lastDate={datas.expire} />
</p>
</div>
</div> */}
<div className="w-full p-2 rounded-lg border border-[#E3E4FE] dark:border-[#a7a9b533] "> <div className="w-full p-2 rounded-lg border border-[#E3E4FE] dark:border-[#a7a9b533] ">
<div className="grid grid-cols-2 gap-2"> <div className="grid grid-cols-2 gap-2">
<div className="flex flex-col justify-between items-center border-r-2"> <div className="flex flex-col justify-between items-center border-r-2">
@@ -96,7 +82,7 @@ export default function OfferCard({ datas, hidden = false, setOfferPopout }) {
<button <button
type="button" type="button"
onClick={() => onClick={() =>
setOfferPopout({ show: true, data: { ...datas, thePrice } }) setOfferPopout({ show: true, data: { ...datas, thePrice, image } })
} }
className="btn-shine w-[98px] h-[33px] text-white rounded-full text-sm bg-pink flex justify-center items-center" className="btn-shine w-[98px] h-[33px] text-white rounded-full text-sm bg-pink flex justify-center items-center"
> >
@@ -33,7 +33,7 @@ export default function FamilyManageTabs({
loading: false, loading: false,
data: null, data: null,
}; };
console.log('accountDetails',accountDetails) // console.log('accountDetails',accountDetails)
// State for family details, tasks, waitlist, and pending // State for family details, tasks, waitlist, and pending
const [details, setDetails] = useState({ const [details, setDetails] = useState({
familyDetails: { ...initialDetailState }, familyDetails: { ...initialDetailState },
@@ -201,7 +201,7 @@ const AssignTaskPopout = React.memo(
</svg> </svg>
</button> </button>
</div> </div>
{familyTask.loading ? ( {familyTask?.loading ? (
<div className="h-[100px] w-full flex justify-center items-center"> <div className="h-[100px] w-full flex justify-center items-center">
<LoadingSpinner color="sky-blue" size="16" /> <LoadingSpinner color="sky-blue" size="16" />
</div> </div>
@@ -69,7 +69,7 @@ export default function NewTasks({ formState, setFormState }) {
onChange={handleInputChange} onChange={handleInputChange}
// onBlur={props.handleBlur} // onBlur={props.handleBlur}
> >
{currency.loading ? ( {currency?.loading ? (
<option className="text-slate-500 text-[13.975px]" value=""> <option className="text-slate-500 text-[13.975px]" value="">
Loading... Loading...
</option> </option>
+1 -1
View File
@@ -87,7 +87,7 @@ export default function FamilyTable({
</div> </div>
<div className="flex flex-col flex-[0.9]"> <div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap"> <h1 className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
{`${firstname} ${lastname} (${age})`} {`${firstname} ${lastname} (${age < 10 ? `0${age}` : age})`}
</h1> </h1>
<span className="text-sm text-thin-light-gray"> <span className="text-sm text-thin-light-gray">
Added: <span className="text-purple ml-1">{addedDate}</span> Added: <span className="text-purple ml-1">{addedDate}</span>
@@ -54,7 +54,7 @@ export default function FamilyPending({
value?.currency_code, value?.currency_code,
value?.currency value?.currency
); );
let image = value.banner ? value.banner : "default.jpg"; let image = `${familyData.session_image_server}${localStorage.getItem('session_token')}/job/${value.job_uid}`
return ( return (
<tr <tr
key={index} key={index}
@@ -64,9 +64,7 @@ export default function FamilyPending({
<div className="flex space-x-2 items-center w-full"> <div className="flex space-x-2 items-center w-full">
<div className="w-[60px] h-[60px] p-2 bg-alice-blue rounded-full overflow-hidden flex justify-center items-center"> <div className="w-[60px] h-[60px] p-2 bg-alice-blue rounded-full overflow-hidden flex justify-center items-center">
<img <img
src={localImgLoad( src={image}
`images/taskbanners/${image}`
)}
alt="data" alt="data"
className="w-full h-full rounded-full" className="w-full h-full rounded-full"
/> />
@@ -67,9 +67,7 @@ export default function FamilyTasks({
value?.currency_code, value?.currency_code,
value?.currency value?.currency
); );
let image = value.banner let image = `${familyData.session_image_server}${localStorage.getItem('session_token')}/job/${value.job_uid}`
? value.banner
: "default.jpg";
return ( return (
<tr <tr
key={index} key={index}
@@ -79,9 +77,7 @@ export default function FamilyTasks({
<div className="flex space-x-2 items-center w-full"> <div className="flex space-x-2 items-center w-full">
<div className="w-[60px] h-[60px] p-2 bg-alice-blue rounded-full overflow-hidden flex justify-center items-center"> <div className="w-[60px] h-[60px] p-2 bg-alice-blue rounded-full overflow-hidden flex justify-center items-center">
<img <img
src={localImgLoad( src={image}
`images/taskbanners/${image}`
)}
alt="data" alt="data"
className="w-full h-full rounded-full" className="w-full h-full rounded-full"
/> />
@@ -67,6 +67,8 @@ const FamilyWaitlist = memo(
const selectedImage = require(`../../../assets/images/family/${ const selectedImage = require(`../../../assets/images/family/${
value?.banner || "default.jpg" value?.banner || "default.jpg"
}`); }`);
console.log('VALUE', value)
// let image = `${familyData.session_image_server}${localStorage.getItem('session_token')}/job/${value.job_uid}`
return ( return (
<tr <tr
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50" className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
+1 -1
View File
@@ -151,7 +151,7 @@ export default function FamilyAcc() {
> >
Family Accounts Family Accounts
</span> </span>
{familyList.length < process.env.REACT_APP_MAX_FAMILY_MEMBERS && {familyList?.result_list?.length < process.env.REACT_APP_MAX_FAMILY_MEMBERS &&
!loader && ( !loader && (
<button <button
onClick={popUpHandler} onClick={popUpHandler}
+3 -3
View File
@@ -478,13 +478,13 @@ export default function Icons({ name }) {
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
fill="none" fill="none"
viewBox="0 0 24 24" viewBox="0 0 24 24"
stroke-width="1.5" strokeWidth="1.5"
stroke="currentColor" stroke="currentColor"
className="w-4 h-4" className="w-4 h-4"
> >
<path <path
stroke-linecap="round" strokeLinecap="round"
stroke-linejoin="round" strokeLinejoin="round"
d="M8.25 4.5l7.5 7.5-7.5 7.5" d="M8.25 4.5l7.5 7.5-7.5 7.5"
/> />
</svg> </svg>
+2 -2
View File
@@ -4,7 +4,7 @@ import Icons from "../Helpers/Icons";
import SliderCom from "../Helpers/SliderCom"; import SliderCom from "../Helpers/SliderCom";
import FamilyActiveJobsCard from "../Cards/FamilyActiveJobsCard"; import FamilyActiveJobsCard from "../Cards/FamilyActiveJobsCard";
export default function FamilyActiveLSlde({ className, trending }) { export default function FamilyActiveLSlde({ className, trending, image_server }) {
const settings = { const settings = {
arrows: false, arrows: false,
slidesToShow: 3, slidesToShow: 3,
@@ -98,7 +98,7 @@ export default function FamilyActiveLSlde({ className, trending }) {
{trending && {trending &&
trending.length > 0 && trending.length > 0 &&
trending.map((item) => ( trending.map((item) => (
<FamilyActiveJobsCard key={item.id} datas={item} /> <FamilyActiveJobsCard key={item.id} datas={item} image_server={image_server} />
))} ))}
</SliderCom> </SliderCom>
</div> </div>
+8 -4
View File
@@ -4,18 +4,22 @@ import MyOffersFamilyTable from "../MyTasks/MyOffersFamilyTable";
import FamilyActiveLSlde from "./FamilyActiveLSlde"; import FamilyActiveLSlde from "./FamilyActiveLSlde";
export default function FamilyDash({ familyOffers, MyActiveJobList }) { export default function FamilyDash({ familyOffers, MyActiveJobList }) {
console.log("PROPS IN FAMILY DASH->", familyOffers); // console.log("PROPS IN FAMILY DASH->", familyOffers?.result_list);
const trending = MyActiveJobList; const trending = MyActiveJobList;
return ( return (
<div> <div>
<div className="home-page-wrapper"> <div className="home-page-wrapper">
{/* <CommonHead commonHeadData={props.commonHeadData} /> */} {/* <CommonHead commonHeadData={props.commonHeadData} /> */}
{familyOffers && familyOffers.length > 0 && ( {familyOffers?.result_list && familyOffers?.result_list.length > 0 && (
<MyOffersFamilyTable familyOffers={familyOffers} className="mb-10" /> <MyOffersFamilyTable
familyOffers={familyOffers?.result_list}
image_server={familyOffers?.session_image_server}
className="mb-10"
/>
)} )}
{trending && trending.length > 0 && ( {trending && trending.length > 0 && (
<FamilyActiveLSlde trending={trending} className="mb-10" /> <FamilyActiveLSlde trending={trending} className="mb-10" image_server={familyOffers?.session_image_server} />
)} )}
{/*<TopSellerTopBuyerSliderSection className="mb-10" />*/} {/*<TopSellerTopBuyerSliderSection className="mb-10" />*/}
+1
View File
@@ -34,6 +34,7 @@ export default function FullAccountDash(props) {
<MyJobTable <MyJobTable
ActiveJobList={props.MyActiveJobList} ActiveJobList={props.MyActiveJobList}
Account={userDetails} Account={userDetails}
imageServer={props.offersList?.data?.session_image_server}
/> />
</> </>
) : !props.offersList?.loading && !props.MyActiveJobList?.loading ? ( ) : !props.offersList?.loading && !props.MyActiveJobList?.loading ? (
+1 -1
View File
@@ -75,7 +75,7 @@ export default function Home(props) {
<FamilyDash <FamilyDash
account={userDetails} account={userDetails}
commonHeadData={props.bannerList} commonHeadData={props.bannerList}
familyOffers={MyOffersList?.data?.result_list} familyOffers={MyOffersList?.data}
MyActiveJobList={MyActiveJobList?.data} MyActiveJobList={MyActiveJobList?.data}
/> />
) : userDetails && userDetails?.account_type == "FULL" ? ( ) : userDetails && userDetails?.account_type == "FULL" ? (
+6 -4
View File
@@ -108,9 +108,11 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
value?.currency value?.currency
); );
const image = `${image_server}${localStorage.getItem( const image = localStorage.getItem("session_token")
"session_token" ? `${image_server}${localStorage.getItem("session_token")}/job/${
)}/job/${value.job_uid}`; value.job_uid
}`
: "";
return ( return (
<tr <tr
@@ -218,7 +220,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
contentBodyClasses="w-auto min-w-max" contentBodyClasses="w-auto min-w-max"
/> />
</div> </div>
{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]"> <div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between min-h-[520px]">
+4 -3
View File
@@ -10,7 +10,7 @@ import localImgLoad from "../../lib/localImgLoad";
const noTasksBg = require("../../assets/images/no-task-background.jpg"); const noTasksBg = require("../../assets/images/no-task-background.jpg");
const noFamilyTasksBg = require("../../assets/images/family-no-task-background.jpg"); const noFamilyTasksBg = require("../../assets/images/family-no-task-background.jpg");
export default function MyJobTable({ className, ActiveJobList, Account }) { export default function MyJobTable({ className, ActiveJobList, Account, imageServer }) {
let navigate = useNavigate(); let navigate = useNavigate();
let { pathname } = useLocation(); let { pathname } = useLocation();
@@ -55,7 +55,7 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
{!ActiveJobList?.data.length && accountType && ( {!ActiveJobList?.data.length && accountType && (
<div className="absolute inset-0 bg-black opacity-30"></div> <div className="absolute inset-0 bg-black opacity-30"></div>
)} )}
{ActiveJobList.loading ? {ActiveJobList?.loading ?
<div className="w-full h-[520px] flex items-center justify-center"> <div className="w-full h-[520px] flex items-center justify-center">
<LoadingSpinner size="16" color="sky-blue" /> <LoadingSpinner size="16" color="sky-blue" />
</div> </div>
@@ -71,6 +71,7 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
task?.currency_code, task?.currency_code,
task?.currency task?.currency
); );
let image = `${imageServer}${localStorage.getItem('session_token')}/job/${task.origin_job_uid}`
return ( return (
<div <div
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] w-full flex justify-between items-center hover:bg-gray-50" className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] w-full flex justify-between items-center hover:bg-gray-50"
@@ -80,7 +81,7 @@ export default function MyJobTable({ className, ActiveJobList, Account }) {
<div className="flex space-x-2 items-center"> <div className="flex space-x-2 items-center">
<div className="w-full min-w-[60px] max-w-[60px] flex-[0.1] h-[60px] rounded-full overflow-hidden flex justify-center items-center"> <div className="w-full min-w-[60px] max-w-[60px] flex-[0.1] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img <img
src={localImgLoad(`images/taskbanners/${task?.banner}`)} src={image}
alt="data" alt="data"
className="w-full h-full" className="w-full h-full"
/> />
@@ -4,7 +4,7 @@ import Icons from "../Helpers/Icons";
import SliderCom from "../Helpers/SliderCom"; import SliderCom from "../Helpers/SliderCom";
import FamilyOfferJobPopout from "../jobPopout/FamilyOfferJobPopout"; import FamilyOfferJobPopout from "../jobPopout/FamilyOfferJobPopout";
export default function MyOffersFamilyTable({ className, familyOffers }) { export default function MyOffersFamilyTable({ className, familyOffers, image_server }) {
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
const settings = { const settings = {
arrows: false, arrows: false,
@@ -117,6 +117,7 @@ export default function MyOffersFamilyTable({ className, familyOffers }) {
key={item.id} key={item.id}
datas={item} datas={item}
setOfferPopout={setOfferPopout} setOfferPopout={setOfferPopout}
image_server={image_server}
/> />
); );
})} })}
+1 -1
View File
@@ -122,7 +122,7 @@ export default function MyOffersTable({ className, MyActiveOffersList }) {
MyActiveOffersList?.result_list?.length > 0 && MyActiveOffersList?.result_list?.length > 0 &&
MyActiveOffersList.result_list.map((item) => { MyActiveOffersList.result_list.map((item) => {
return ( return (
<OfferCard key={item.id} datas={item} setOfferPopout={setOfferPopout} /> <OfferCard key={item.id} datas={item} setOfferPopout={setOfferPopout} image_server={MyActiveOffersList.session_image_server} />
) )
})} })}
</SliderCom> </SliderCom>
+1 -1
View File
@@ -94,7 +94,7 @@ export default function MyTasks({
</button> </button>
} }
</div> </div>
<MyJobTable ActiveJobList={ActiveJobList} Account={userDetails} /> <MyJobTable ActiveJobList={ActiveJobList} Account={userDetails} imageServer={MyActiveOffersList.session_image_server} />
</div> </div>
</div> </div>
</Layout> </Layout>
@@ -44,7 +44,7 @@ export default function MyWaitingJobTable({ MyJobList, className }) {
value?.currency_code, value?.currency_code,
value?.currency value?.currency
); );
let image = `${MyJobList.session_image_server}${localStorage.getItem('session_token')}/job/${value.offer_uid}` let image = `${MyJobList.session_image_server}${localStorage.getItem('session_token')}/job/${value.job_uid}`
return ( return (
<tr <tr
key={index} key={index}
@@ -170,9 +170,9 @@ function ConfirmNairaWithdraw({
viewBox="0 0 24 24" viewBox="0 0 24 24"
fill="none" fill="none"
stroke="green" stroke="green"
stroke-width="2" strokeWidth="2"
stroke-linecap="round" strokeLinecap="round"
stroke-linejoin="round" strokeLinejoin="round"
className="feather feather-check-circle" className="feather feather-check-circle"
> >
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path> <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
@@ -186,9 +186,9 @@ function ConfirmNairaWithdraw({
width="100" width="100"
height="100" height="100"
stroke="red" stroke="red"
stroke-width="2" strokeWidth="2"
stroke-linecap="round" strokeLinecap="round"
stroke-linejoin="round" strokeLinejoin="round"
className="feather feather-x-circle" className="feather feather-x-circle"
> >
<circle cx="12" cy="12" r="10"></circle> <circle cx="12" cy="12" r="10"></circle>
+21
View File
@@ -1,5 +1,7 @@
import { useSelector } from "react-redux";
import LoadingSpinner from "../Spinners/LoadingSpinner"; import LoadingSpinner from "../Spinners/LoadingSpinner";
import WalletItemCard from "./WalletItemCard"; import WalletItemCard from "./WalletItemCard";
import WalletItemCardFamily from "./WalletItemCardFamily";
/** /**
* Renders a list of wallet items or a loading spinner depending on the state of the `wallet` object. * Renders a list of wallet items or a loading spinner depending on the state of the `wallet` object.
@@ -7,9 +9,27 @@ import WalletItemCard from "./WalletItemCard";
export default function WalletBox({ wallet, payment, countries }) { export default function WalletBox({ wallet, payment, countries }) {
const { loading, data } = wallet; const { loading, data } = wallet;
const { userDetails } = useSelector((state) => state.userDetails);
const accountType = userDetails?.account_type === "FAMILY";
return ( return (
<div className="my-wallet-wrapper w-full mb-10"> <div className="my-wallet-wrapper w-full mb-10">
<div className="main-wrapper w-full"> <div className="main-wrapper w-full">
{accountType ?
<div className="balance-inquery w-auto grid sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] gap-5 mb-11 h-auto">
{loading ? (
<div className="w-full h-full flex items-center justify-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
) : (
data.length > 0 && data.map((item) => (
<div key={item.wallet_uid} className="lg:w-full h-full mb-10 lg:mb-0">
<WalletItemCardFamily walletItem={item} payment={payment} countries={countries} />
</div>
))
)}
</div>
:
<div className="balance-inquery w-auto grid sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] gap-5 mb-11 h-auto"> <div className="balance-inquery w-auto grid sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] gap-5 mb-11 h-auto">
{loading ? ( {loading ? (
<div className="w-full h-full flex items-center justify-center"> <div className="w-full h-full flex items-center justify-center">
@@ -23,6 +43,7 @@ export default function WalletBox({ wallet, payment, countries }) {
)) ))
)} )}
</div> </div>
}
</div> </div>
</div> </div>
); );
+6 -9
View File
@@ -11,8 +11,7 @@ import WalletAction from "./WalletAction";
* Renders a card displaying information about a wallet item. * Renders a card displaying information about a wallet item.
*/ */
export default function WalletItemCard({ walletItem, payment, countries }) { export default function WalletItemCard({ walletItem, payment, countries }) {
const { userDetails } = useSelector((state) => state.userDetails);
const accountType = userDetails?.account_type === "FAMILY";
const dispatch = useDispatch(); const dispatch = useDispatch();
const [creditPopup, setCreditPopup] = useState({ show: false, data: {} }); const [creditPopup, setCreditPopup] = useState({ show: false, data: {} });
@@ -91,13 +90,11 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
<div className="my-2 w-full h-[1px] bg-white"></div> <div className="my-2 w-full h-[1px] bg-white"></div>
{!accountType && ( <WalletAction
<WalletAction walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }} payment={payment}
payment={payment} openPopUp={openPopUp}
openPopUp={openPopUp} />
/>
)}
</div> </div>
{creditPopup.show && ( {creditPopup.show && (
@@ -0,0 +1,109 @@
import React, { useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import background from "../../assets/images/bg-sky-blue.jpg"; //shape/balance-bg.svg";
import localImgLoad from "../../lib/localImgLoad";
import { tableReload } from "../../store/TableReloads";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import CreditPopup from "./Popup/CreditPopup";
import WalletAction from "./WalletAction";
/**
* Renders a card displaying information about a wallet item.
*/
export default function WalletItemCardFamily({ walletItem, payment, countries }) {
const dispatch = useDispatch();
const [creditPopup, setCreditPopup] = useState({ show: false, data: {} });
/**
* Opens the credit popup.
* @param {Object} value - The value object.
*/
const openPopUp = (value) => {
setCreditPopup({
show: true,
data: { ...value },
});
};
/**
* Closes the credit popup and dispatches a table reload action.
*/
const closePopUp = () => {
setCreditPopup({ show: false, data: {} });
dispatch(tableReload({ type: "WALLETTABLE" }));
};
const currentWalletCurrency = countries
.map((country) => country)
.filter((country) => country[0] === walletItem.country);
const image = walletItem.code
? `${walletItem.code.toLowerCase()}.svg`
: "default.png";
return (
<>
<div
className="current-balance-widget w-full h-full rounded-2xl overflow-hidden flex flex-col items-center gap-2 p-8 justify-between"
style={{
background: `url(${background}) 0% 0% / cover no-repeat`,
}}
>
<div className="wallet w-full flex justify-between items-start gap-3">
<div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
<img
src={localImgLoad(`images/currency/${image}`)}
className="w-full h-full"
alt="currency-icon"
/>
</div>
<div className="balance w-full mt-2 flex justify-center">
<div className="">
<p className="text-base sm:text-lg text-white opacity-[70%] tracking-wide mb-2 sm:mb-6">
Current Balance
</p>
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10 xxs:scale-100 lg:scale-100 xl:scale-125">
{PriceFormatter(
walletItem.amount * 0.01,
walletItem.code,
undefined,
"text-[2rem]"
)}
</p>
</div>
</div>
</div>
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
HOLDINGS :{" "}
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
{PriceFormatter(
walletItem.escrow * 0.01,
walletItem.code,
undefined,
"text-[2rem]"
)}
</span>
</p>
<div className="my-2 w-full h-[1px] bg-white"></div>
{/* <WalletAction
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
payment={payment}
openPopUp={openPopUp}
/> */}
</div>
{creditPopup.show && (
<CreditPopup
details={creditPopup.data}
walletItem={walletItem}
onClose={closePopUp}
situation={openPopUp}
/>
)}
</>
);
}
+11 -3
View File
@@ -36,9 +36,17 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
const { notifications } = useSelector((state) => state?.notifications); // NOTIFICATION STORE const { notifications } = useSelector((state) => state?.notifications); // NOTIFICATION STORE
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
const image = `${userDetails.session_image_server}${localStorage.getItem( const image = localStorage.getItem("session_token")
"session_token" ? userDetails.account_type === "FAMILY"
)}/profile/${userDetails.uid}`; ? `${userDetails.session_image_server}${localStorage.getItem(
"session_token"
)}/family/${sessionStorage.getItem("family_uid")}`
: `${userDetails.session_image_server}${localStorage.getItem(
"session_token"
)}/profile/${userDetails.uid}`
: "";
// 9308RDR122
const handlerBalance = () => { const handlerBalance = () => {
setbalanceValue.toggle(); setbalanceValue.toggle();
+1
View File
@@ -23,6 +23,7 @@ export default function Layout({ children }) {
localStorage.removeItem("session_token"); localStorage.removeItem("session_token");
localStorage.removeItem("member_id"); localStorage.removeItem("member_id");
localStorage.removeItem("uid"); localStorage.removeItem("uid");
sessionStorage.removeItem("family_uid");
// localStorage.clear(); // localStorage.clear();
// toast.success("Come Back Soon", { // toast.success("Come Back Soon", {
// icon: `🙂`, // icon: `🙂`,
@@ -49,9 +49,11 @@ export default function PersonalInfoTab({
}) { }) {
let { userDetails } = useSelector((state) => state.userDetails); let { userDetails } = useSelector((state) => state.userDetails);
const image = `${userDetails.session_image_server}${localStorage.getItem( const image = localStorage.getItem("session_token")
"session_token" ? `${userDetails.session_image_server}${localStorage.getItem(
)}/profile/${userDetails.uid}`; "session_token"
)}/profile/${userDetails.uid}`
: "";
const apiCall = new usersService(); const apiCall = new usersService();
@@ -101,6 +101,8 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
}); });
}; };
console.log(details)
return ( return (
<ModalCom action={onClose} situation={situation}> <ModalCom action={onClose} situation={situation}>
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto"> <div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
@@ -138,7 +140,7 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
<div className="p-4 w-full md:w-3/4 md:border-r-2"> <div className="p-4 w-full md:w-3/4 md:border-r-2">
<div className="flex gap-2"> <div className="flex gap-2">
<div className="image-wrapper w-32"> <div className="image-wrapper w-32">
<img className="w-full h-auto" src={localImgLoad(`images/taskbanners/${details.banner}`)} alt='Banner-Image' /> <img className="w-full h-auto" src={details?.image} alt='banner' />
</div> </div>
<div className="details-wrapper"> <div className="details-wrapper">
<p className="text-lg my-5 font-semibold text-slate-900 tracking-wide"> <p className="text-lg my-5 font-semibold text-slate-900 tracking-wide">
+10 -5
View File
@@ -21,10 +21,12 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
const [loadProfileDetails, setLoadProfileDetails] = useState([]); const [loadProfileDetails, setLoadProfileDetails] = useState([]);
const navigate = useNavigate(); const navigate = useNavigate();
const { jobListTable, walletTable } = useSelector((state) => state.tableReload); const { jobListTable, walletTable } = useSelector(
(state) => state.tableReload
);
const { const {
userDetails: { username, uid, session }, userDetails: { username, uid, session},
} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active } = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
let loggedIn = username && session && uid ? true : false; // variable to determine if user is logged in let loggedIn = username && session && uid ? true : false; // variable to determine if user is logged in
@@ -35,6 +37,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
localStorage.removeItem("uid"); localStorage.removeItem("uid");
localStorage.removeItem("member_id"); localStorage.removeItem("member_id");
localStorage.removeItem("session_token"); localStorage.removeItem("session_token");
sessionStorage.removeItem("family_uid");
navigate("/login", { replace: true }); // redirects user to login page after session expires navigate("/login", { replace: true }); // redirects user to login page after session expires
}; };
@@ -181,13 +184,15 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
useEffect(() => { useEffect(() => {
const getMyWalletList = async () => { const getMyWalletList = async () => {
dispatch(updateWalletDetails({ loading: true, data:[] })); dispatch(updateWalletDetails({ loading: true, data: [] }));
try { try {
const res = await apiCall.getUserWallets(); const res = await apiCall.getUserWallets();
console.log("wallet - >", res.data); console.log("wallet - >", res.data);
dispatch(updateWalletDetails({ loading: false, data:res.data?.result_list })); dispatch(
updateWalletDetails({ loading: false, data: res.data?.result_list })
);
} catch (error) { } catch (error) {
dispatch(updateWalletDetails({ loading: false, data:[] })); dispatch(updateWalletDetails({ loading: false, data: [] }));
console.log("Error getting mode"); console.log("Error getting mode");
} }
}; };