diff --git a/.env.production b/.env.production
index d30af61..88d656b 100644
--- a/.env.production
+++ b/.env.production
@@ -43,5 +43,4 @@ REACT_APP_GOOGLE_REDIRECT_URL=https://users.wrenchboard.com/login/auth/
DISABLE_ESLINT_PLUGIN=true
REACT_APP_MAX_FILE_SIZE=1000000
-REACT_APP_TOTAL_NUM_FILE=4
-
+REACT_APP_TOTAL_NUM_FILE=4
\ No newline at end of file
diff --git a/src/components/Cards/HomeBannerOffersCard.jsx b/src/components/Cards/HomeBannerOffersCard.jsx
index 02e58ef..f5fd0ed 100644
--- a/src/components/Cards/HomeBannerOffersCard.jsx
+++ b/src/components/Cards/HomeBannerOffersCard.jsx
@@ -1,42 +1,51 @@
-import React from "react";
+import React, { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import localImgLoad from "../../lib/localImgLoad";
+import bannerImage from "../../assets/images/banner-coupons.jpg";
export default function HomeBannerOffersCard(props) {
- console.log("HomeBannerOffersCard-> ##->",props)
- const link_result = "/" + props.itemData.link_path;
- var imgUrl = props.itemData.banner; // ? this.state.nextImgSrc : this.state.song.imgSrc;
- console.log("IMAGE FOR BANNER->",imgUrl);
- var divStyle = {
- backgroundImage: 'url(' + imgUrl + ')'
- }
- var linkDivStyle = "item w-full block group banner-630-340 " + divStyle;
+ const [imageUrl, setImageUrl] = useState("");
+ console.log("HomeBannerOffersCard-> ##->", props);
+ const link_result = "/" + props.itemData.link_path;
+ var imgUrl = props.itemData.banner; // ? this.state.nextImgSrc : this.state.song.imgSrc;
+ console.log("IMAGE FOR BANNER->", imgUrl);
+ useEffect(() => {
+ let { banner, banner_location } = props?.itemData;
+ if (banner_location === "LOCAL") {
+ const imagePath = require(`../../assets/images/${banner}`); // Replace with your directory path for local images
+ console.log("This is local");
+ setImageUrl(imagePath);
+ } else if (banner_location === "URL") setImageUrl(banner);
+ else return null;
+ }, []);
- return (
-
-
-
-
-
- <>{props.itemData.title}>
-
-
- {/*
*/}
-
-
-
- {props.itemData.description}
-
-
- [ {props.itemData.button_text} ]
-
-
-
-
-
- );
+ return (
+
+
+
+
+
+ <>{props.itemData.title}>
+
+
+ {/*
*/}
+
+
+
+ {props.itemData.description}
+
+
+ [ {props.itemData.button_text} ]
+
+
+
+
+ );
}
diff --git a/src/components/Home/FullAccountDash.jsx b/src/components/Home/FullAccountDash.jsx
index 5e44e3c..feff276 100644
--- a/src/components/Home/FullAccountDash.jsx
+++ b/src/components/Home/FullAccountDash.jsx
@@ -10,37 +10,37 @@ import { useSelector } from "react-redux";
import HomeActivities from "./HomeActivities";
export default function FullAccountDash(props) {
+ console.log("PROPS IN HOME->", props);
- console.log("PROPS IN HOME->",props);
+ const trending = datas.datas;
+ const jobData = datas.datas; // api calls or cache
- const trending = datas.datas;
- const jobData = datas.datas; // api calls or cache
-
- const userApi = new usersService();
+ const userApi = new usersService();
- const {userDetails} = useSelector((state) => state?.userDetails)
+ const { userDetails } = useSelector((state) => state?.userDetails);
- return (
-
-
-
-
- {/*
*/}
- {/*
*/}
- {/*
*/}
+ return (
+
+
+
+
+ {/**/}
+ {/**/}
+ {/**/}
- {/**/}
-
-
- );
+ {/*
*/}
+
+
+ );
}
// /*
//
@@ -53,10 +53,10 @@ export default function FullAccountDash(props) {
// className="mb-10"
// bannerList={props.bannerList}
// />
-{/*
+{
+ /*
- */}
+ */
+}
//
//
-
-
diff --git a/src/components/Home/Hero.jsx b/src/components/Home/Hero.jsx
index 9df9dfa..6e8e0f7 100644
--- a/src/components/Home/Hero.jsx
+++ b/src/components/Home/Hero.jsx
@@ -19,10 +19,10 @@ export default function Hero({ className, bannerList, nextDueTask }) {
infinite: true,
swipe: true,
};
- const sildeData =null;
+ const sildeData = null;
const [addFavorite, setValue] = useState(false);
- const {userDetails} = useSelector((state) => state?.userDetails)
+ const { userDetails } = useSelector((state) => state?.userDetails);
const favoriteHandler = () => {
if (!addFavorite) {
setValue(true);
@@ -33,9 +33,9 @@ export default function Hero({ className, bannerList, nextDueTask }) {
}
};
- let loginDate = userDetails?.last_login.split(' ')[0]
- let {firstname, lastname, email, profile_pic} = userDetails
- let userEmail = email.split('@')[0]
+ let loginDate = userDetails?.last_login.split(" ")[0];
+ let { firstname, lastname, email, profile_pic } = userDetails;
+ let userEmail = email.split("@")[0];
return (
- Last Login : {loginDate}
+ Last Login : {loginDate}
{/* user */}
-

+
@@ -71,38 +71,35 @@ export default function Hero({ className, bannerList, nextDueTask }) {
{/* countdown */}
- { nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length &&
- (
-
-
-
Current Task
-
- {nextDueTask.next_due.item_code}
-
-
{nextDueTask.next_due.price} Naira
-
-
-
-
Next due in
-
- {/* */}
-
-
-
- Hrs
- Min
- Sec
-
+ {nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length && (
+
+
+
Current Task
+
+ {nextDueTask.next_due.item_code}
+
+
+ {nextDueTask.next_due.price} Naira
+
+
+
+
+
Next due in
+
+ {/* */}
+
+
+
+ Hrs
+ Min
+ Sec
- )
- }
+
+ )}
{/* action */}
-
+
{" "}
View All Task(s)
@@ -111,9 +108,9 @@ export default function Hero({ className, bannerList, nextDueTask }) {
);
diff --git a/src/components/Home/HomeSliders.jsx b/src/components/Home/HomeSliders.jsx
index ee31333..f322e53 100644
--- a/src/components/Home/HomeSliders.jsx
+++ b/src/components/Home/HomeSliders.jsx
@@ -1,37 +1,26 @@
import SliderCom from "../Helpers/SliderCom";
-import slider1 from "../../assets/images/slider-1.jpg";
-import slider2 from "../../assets/images/slider-2.jpg";
-import slider3 from "../../assets/images/slider-3.jpg";
import HomeBannerOffersCard from "../Cards/HomeBannerOffersCard";
-
export default function HomeSliders(props) {
- console.log("BANNER LIST IN HomeSliders->",props.bannerList);
- // debugger;
- return (
- <>
-
-
-
- {/**/}
- {/*

*/}
- {/*
*/}
-
-

-
- {/**/}
- {/*

*/}
- {/*
*/}
- {props.bannerList?.length && props.bannerList.map((item, index) => (
-
-
-
- ))}
-
+ console.log("BANNER LIST IN HomeSliders->", props.bannerList);
+ // debugger;
+ return (
+ <>
+
+
+
+ {props.bannerList?.length &&
+ props.bannerList.map((item, index) => (
+
+
-
- >
- );
+ ))}
+
+
+
+ >
+ );
}
diff --git a/src/components/Home/index.jsx b/src/components/Home/index.jsx
index 49ad10b..f3e148d 100644
--- a/src/components/Home/index.jsx
+++ b/src/components/Home/index.jsx
@@ -6,48 +6,51 @@ import { useSelector } from "react-redux";
import FamilyDash from "./FamilyDash";
import FullAccountDash from "./FullAccountDash";
-
export default function Home(props) {
+ console.log("PROPS IN HOME->", props);
- console.log("PROPS IN HOME->",props);
+ let [nextDueTask, setNextDueTask] = useState({});
- let [nextDueTask, setNextDueTask] = useState({})
+ const userApi = new usersService();
- const userApi = new usersService();
+ const { userDetails } = useSelector((state) => state?.userDetails);
- const {userDetails} = useSelector((state) => state?.userDetails)
+ const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
- const {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
+ // FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
+ const getHomeDate = () => {
+ userApi
+ .getHomeDate()
+ .then((res) => {
+ if (res.status != 200 || res.internal_return < 0) {
+ return;
+ }
+ setNextDueTask(res.data);
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ };
- // FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
- const getHomeDate = () => {
- userApi.getHomeDate().then(res => {
- if(res.status != 200 || res.internal_return < 0){
- return
- }
- setNextDueTask(res.data)
- }).catch(error => {
- console.log(error)
- })
- }
+ useEffect(() => {
+ getHomeDate();
+ }, []);
- useEffect(()=>{
- getHomeDate()
- },[])
-
- return (
-
-
- {userDetails && userDetails?.account_type == "FAMILY" && (
-
- )}
- {userDetails && userDetails?.account_type == "FULL" && (
-
-
- )}
-
-
- );
+ return (
+
+
+ {userDetails && userDetails?.account_type == "FAMILY" && (
+
+ )}
+ {userDetails && userDetails?.account_type == "FULL" && (
+
+ )}
+
+
+ );
}
// /*
//
@@ -60,10 +63,10 @@ export default function Home(props) {
// className="mb-10"
// bannerList={props.bannerList}
// />
-{/*
+{
+ /*
- */}
+ */
+}
//
//
-
-
diff --git a/src/lib/localImgLoad.js b/src/lib/localImgLoad.js
index e0aa6af..beac126 100644
--- a/src/lib/localImgLoad.js
+++ b/src/lib/localImgLoad.js
@@ -1,4 +1,7 @@
-export default function localImgLoad(location) {
- const img = require(`../assets/${location}`);
- return img;
-}
+// export default function localImgLoad(location) {
+// const img = require(`../assets/${location}`);
+// return img;
+// }
+
+// const localImgLoad = (location) => require(`../assets/${location}`);
+// export default localImgLoad
\ No newline at end of file