Compare commits

..

4 Commits

6 changed files with 55 additions and 31 deletions
+10 -2
View File
@@ -1,7 +1,10 @@
import { Suspense, lazy } from "react";
import localImgLoad from "../../lib/localImgLoad";
import CountDown from "../Helpers/CountDown";
import { PriceFormatter } from "../Helpers/PriceFormatter";
const VideoElement = lazy(() => import("../VideoCom/VideoElement")); // LAZY IMPORTING VIDEO COMPONENT
export default function OfferCard({
datas,
hidden = false,
@@ -19,9 +22,13 @@ export default function OfferCard({
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="content">
{/* thumbnail */}
<div className="w-full h-40">
{/* thumbnail image */}
{/* thumbnail image/video */}
{datas.job_type == "MEDIA" ?
<Suspense fallback={<p>Loading...</p>}>
<VideoElement videoId={datas?.media_uid} />
</Suspense>
:
<div
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
style={{
@@ -30,6 +37,7 @@ export default function OfferCard({
>
{hidden && <div className="flex justify-center"></div>}
</div>
}
</div>
{/* details */}
<div className="details">
@@ -195,6 +195,7 @@ export default function FamilyManageTabs({
familyData={details.familyPending.data}
accountDetails={accountDetails}
loader={details.familyPending.loading}
setUpdatePage={setUpdatePage}
/>
),
Account: (
@@ -9,6 +9,7 @@ export default function FamilyPending({
className,
accountDetails,
loader,
setUpdatePage,
}) {
let [jobPopout, setJobPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
@@ -151,6 +152,7 @@ export default function FamilyPending({
details={jobPopout.data}
onClose={() => {
setJobPopout({ show: false, data: {} });
setUpdatePage(prev => !prev);
}}
situation={jobPopout.show}
/>
+9
View File
@@ -0,0 +1,9 @@
import React from 'react'
export default function ImageElement({className, src, alt}) {
return (
<div className='w-full h-full flex justify-center items-center'>
<img src={src} alt={alt} className={`object-cover w-auto h-full ${className && className}`} />
</div>
)
}
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { Suspense, lazy, useState } from "react";
import Detail from "./popoutcomponent/Detail";
import ModalCom from "../Helpers/ModalCom";
import { useNavigate } from "react-router-dom";
@@ -12,6 +12,9 @@ import { useDispatch } from "react-redux";
import { SocketValues } from "../Contexts/SocketIOContext";
const VideoElement = lazy(() => import("../VideoCom/VideoElement"));
const ImageElement = lazy(() => import("../ImageCon/ImageElement"));
function FamilyOfferJobPopout({ details, onClose, situation }) {
const {parentAssignJobToKid} = SocketValues()
@@ -118,8 +121,6 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
});
};
console.log(details)
return (
<ModalCom action={onClose} situation={situation}>
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
@@ -153,12 +154,9 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
</svg>
</button>
</div>
<div className="md:flex bg-white rounded-lg">
<div className="p-4 w-full md:w-3/4 md:border-r-2">
<div className="md:flex bg-white rounded-lg h-[450px] overflow-y-auto">
<div className="p-4 w-full md:w-3/5 md:border-r-2">
<div className="flex gap-2">
<div className="image-wrapper w-32">
<img className="w-full h-auto" src={details?.image} alt='banner' />
</div>
<div className="details-wrapper">
<p className="text-lg my-5 font-semibold text-slate-900 tracking-wide">
{details.title}
@@ -208,7 +206,22 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
</div>
{/* ACTION SECTION */}
<div className="p-4 w-full md:w-1/4 h-full">
<div className="p-4 w-full md:w-2/5 h-full flex flex-col justify-between">
{ details.job_type == 'TASK' ?
<div className="image-wrapper w-full h-40 flex justify-center items-center">
<Suspense fallback={<p className="w-full text-center">Loading...</p>}>
<ImageElement src={details?.image} alt='banner' className='w-auto h-full' />
</Suspense>
</div>
:
<div className="w-full flex justify-center">
<div className="w-full max-w-xs">
<Suspense fallback={<p className="w-full text-center">Loading...</p>}>
<VideoElement videoId={details.media_uid} />
</Suspense>
</div>
</div>
}
<div className="my-3 md:flex md:justify-center">
{requestStatus.loading && requestStatus.trigger == "offer" ? (
<LoadingSpinner size={8} color="sky-blue" />
@@ -238,30 +251,19 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
</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>
{/* close button */}
<div className="modal-footer-wrapper flex justify-end">
<div className="modal-footer-wrapper flex justify-between">
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
<div
className={`relative text-md font-light leading-[19.5px] text-[13px] ${requestStatus.status ? 'text-green-700' : 'text-[#912741]'}`}
>
{requestStatus.message}
</div>
{/* End of error or success display */}
<button
onClick={onClose}
disabled={requestStatus.loading}
@@ -71,7 +71,9 @@ function PendingJobsPopout({ details, onClose, situation }) {
.pendingJobSendTome(reqData)
.then((res) => {
setRequestMessage({ status: true, message: res.data.status });
dispatch(tableReload({ type: "PENDINGTABLE" }));
setTimeout(() => {
onClose()
setPendingJobLoader({ extend: false, offer: false });
setRequestMessage({ status: false, message: "" });
}, 4000);