top banner offer list display fixed
This commit was merged in pull request #791.
This commit is contained in:
@@ -5,13 +5,15 @@ import OfferJobPopout from '../../components/jobPopout/OfferJobPopout'
|
||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||
import CountDown from '../Helpers/CountDown'
|
||||
|
||||
const AccountDashboard = ({ className, bannerList, offersList }) => {
|
||||
const AccountDashboard = ({ className, bannerList, offersList, imageServer }) => {
|
||||
|
||||
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
|
||||
|
||||
let offersListLength = offersList?.length
|
||||
|
||||
// getting the upper three banners for the home layout
|
||||
const getUpperBanner = bannerList?.filter((value, idx) => idx < 2);
|
||||
const getLowerBanner = bannerList?.filter((value, idx) => idx >= 2);
|
||||
const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2 - offersListLength);
|
||||
const getLowerBanner = bannerList?.filter((value, idx) => !getUpperBanner?.map(item => item?.title)?.includes(value.title));
|
||||
|
||||
let getImage = ({ banner_location, banner }) => {
|
||||
if (banner_location == "LOCAL") {
|
||||
@@ -33,15 +35,15 @@ const AccountDashboard = ({ className, bannerList, offersList }) => {
|
||||
|
||||
{/* OFFER LIST DISPLAY */}
|
||||
<>
|
||||
{(offersList && offersList?.result_list?.length > 0) &&
|
||||
offersList.result_list.map((item, index) => {
|
||||
{(offersList && offersList?.length > 0) &&
|
||||
offersList.map((item, index) => {
|
||||
let thePrice = PriceFormatter(
|
||||
item?.price * 0.01,
|
||||
item?.currency_code,
|
||||
item?.currency
|
||||
);
|
||||
|
||||
let image = `${offersList.session_image_server}${localStorage.getItem("session_token")}/job/${item.job_uid}`
|
||||
let image = `${imageServer}${localStorage.getItem("session_token")}/job/${item.job_uid}`
|
||||
return (
|
||||
<div key={item.id}>
|
||||
<NewOfferCard datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
|
||||
|
||||
Reference in New Issue
Block a user