diff --git a/src/components/Dashboards/AccountDashboard.jsx b/src/components/Dashboards/AccountDashboard.jsx index 4cd6187..0f5f361 100644 --- a/src/components/Dashboards/AccountDashboard.jsx +++ b/src/components/Dashboards/AccountDashboard.jsx @@ -1,7 +1,14 @@ -import React from "react"; +import React, { Suspense, lazy, useState } from "react"; import { Link } from "react-router-dom"; +import VideoElement from '../../components/VideoCom/VideoElement' +import OfferJobPopout from '../../components/jobPopout/OfferJobPopout' +import { PriceFormatter } from "../Helpers/PriceFormatter"; +import CountDown from '../Helpers/CountDown' + +const AccountDashboard = ({ className, bannerList, offersList }) => { + + let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW -const AccountDashboard = ({ className, bannerList }) => { // 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); @@ -15,54 +22,89 @@ const AccountDashboard = ({ className, bannerList }) => { }; return ( -
-
- {getUpperBanner?.map((props, idx) => { - let image = getImage(props); + <> +
- let { short_title, short_description, short_button_text, link_path, card_type, blog_id } = - props; +
- return ( -
- -
- ); - })} + {/* OFFER LIST DISPLAY */} + <> + {(offersList && offersList?.result_list?.length > 0) && + offersList.result_list.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}` + return ( +
+ +
+ ) + })} + + + {getUpperBanner?.map((props, idx) => { + let image = getImage(props); + + let { short_title, short_description, short_button_text, link_path, card_type, blog_id } = + props; + + return ( +
+ +
+ ); + })} +
+
+ {getLowerBanner?.map((props, idx) => { + let image = getImage(props); + + let { short_title, short_description, short_button_text, link_path, card_type, blog_id } = + props; + + return ( +
+ +
+ ); + })} +
-
- {getLowerBanner?.map((props, idx) => { - let image = getImage(props); - let { short_title, short_description, short_button_text, link_path, card_type, blog_id } = - props; - - return ( -
- -
- ); - })} -
-
+ {/* Offer Job Popout */} + {offerPopout.show && ( + { + setOfferPopout({ show: false, data: {} }); + }} + situation={offerPopout.show} + /> + )} + {/* End of Offer Job Popout */} + ); }; @@ -103,6 +145,64 @@ const TopBanner = ({ image, title = "", desc = "", btn, link_path, key }) => { ); }; +const NewOfferCard = ({ datas, hidden = false, price, setOfferPopout, image }) => { + return ( +
+
+ {/* thumbnail image/video */} + {datas.job_type == "MEDIA" ? + Loading...

}> + +
+ : +
+ {hidden &&
} +
+ } +
+
+
+

+ {datas?.title} +

+ {/* + {desc} + */} +
+ +
+
+
+
+

Expires

+

+ +

+
+ +
+
+
+ ); +}; + const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type, blog_id, key }) => { const newLinkPath = card_type == 'BLOG' ? `${link_path}?blog_id=${blog_id}` : link_path diff --git a/src/components/Home/FullAccountDash.jsx b/src/components/Home/FullAccountDash.jsx index 748b7e3..226c74f 100644 --- a/src/components/Home/FullAccountDash.jsx +++ b/src/components/Home/FullAccountDash.jsx @@ -62,7 +62,7 @@ export default function FullAccountDash(props) {
{renderDashboard()} {process.env.REACT_APP_SHOW_ACCOUNT_DASH == "1" && ( - + )} {props?.dashTypes !== "undefined" &&