From 2b5de9c95f0b0ba2157d822a03ca102045d89874 Mon Sep 17 00:00:00 2001 From: Ebube Date: Tue, 27 Feb 2024 00:39:51 +0100 Subject: [PATCH] Added the first 3 banners --- .../Dashboards/AccountDashboard.jsx | 64 ++++++++++++++----- src/components/Home/FullAccountDash.jsx | 4 +- 2 files changed, 49 insertions(+), 19 deletions(-) diff --git a/src/components/Dashboards/AccountDashboard.jsx b/src/components/Dashboards/AccountDashboard.jsx index 8c84348..75dc622 100644 --- a/src/components/Dashboards/AccountDashboard.jsx +++ b/src/components/Dashboards/AccountDashboard.jsx @@ -1,6 +1,18 @@ import React from "react"; +import { Link } from "react-router-dom"; -const AccountDashboard = ({ className }) => { +const AccountDashboard = ({ className, bannerList }) => { + const getUpperBanner = bannerList?.slice(0, 3); + + let getImage = ({banner_location, banner}) => { + if (banner_location == "LOCAL") { + return require(`../../assets/images/${banner}`); + } else { + return banner; + } + }; + + console.log(getUpperBanner); return (
{ }`} >
- - - + {getUpperBanner?.map((props, idx) => { + + let image = getImage(props); + + let { short_title, short_description, button_text, link_path } = + props; + + return ( + + ); + })}
-
+
@@ -22,24 +49,29 @@ const AccountDashboard = ({ className }) => { export default AccountDashboard; -const TopBanner = () => { - let Image = require(`../../assets/images/offer.jpg`); +const TopBanner = ({ image, title = "", desc = "", btn, link_path, key }) => { return (
-
+ banner-img -
+
-

Banner Title

-

Banner description text will come follow

+ + {title} + + + {desc} +
- follow up text + + {btn} +
- ); + ); }; -const LowerBanner = () => { +const LowerBanner = ({ image, title = "", desc = "", btn, link_path, key }) => { let Image = require(`../../assets/images/offer.jpg`); return (
diff --git a/src/components/Home/FullAccountDash.jsx b/src/components/Home/FullAccountDash.jsx index 0a37391..e395926 100644 --- a/src/components/Home/FullAccountDash.jsx +++ b/src/components/Home/FullAccountDash.jsx @@ -59,13 +59,11 @@ export default function FullAccountDash(props) { } }; - console.log(process.env.REACT_APP_SHOW_ACCOUNT_DASH) - return ( <>
{process.env.REACT_APP_SHOW_ACCOUNT_DASH == "1" && ( - + )} {renderDashboard()}