From e3a5952675dd3dc911f1b1bd32d8da7206550c3f Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Sun, 2 Jul 2023 08:10:10 +0100 Subject: [PATCH] made blog component to show first when resources link is hit --- src/components/Cards/ResourceBlogCard.jsx | 133 +++++++++++----------- src/components/Resources/index.jsx | 10 +- src/components/Resources/tabs/BlogTab.jsx | 2 +- 3 files changed, 71 insertions(+), 74 deletions(-) diff --git a/src/components/Cards/ResourceBlogCard.jsx b/src/components/Cards/ResourceBlogCard.jsx index 926af1f..e82434f 100644 --- a/src/components/Cards/ResourceBlogCard.jsx +++ b/src/components/Cards/ResourceBlogCard.jsx @@ -4,76 +4,75 @@ import { toast } from "react-toastify"; import localImgLoad from "../../lib/localImgLoad"; import Icons from "../Helpers/Icons"; +import Image from '../../assets/images/Linkedin.png' + export default function ProductCardStyleTwo({ - className, - datas, - hidden = false, - }) { - // debugger; - const [addFavorite, setValue] = useState(datas.whishlisted); - const [options, setOption] = useState(false); - const favoriteHandler = () => { - if (!addFavorite) { - setValue(true); - toast.success("Added to Favorite List"); - } else { - setValue(false); - toast.warn("Remove to Favorite List"); - } - }; - return ( -
-
-
-
-
-
- {datas?.isActive && ( - + className, + datas, + hidden = false, + bg +}) { + // debugger; + const [addFavorite, setValue] = useState(datas.whishlisted); + const [options, setOption] = useState(false); + const favoriteHandler = () => { + if (!addFavorite) { + setValue(true); + toast.success("Added to Favorite List"); + } else { + setValue(false); + toast.warn("Remove to Favorite List"); + } + }; + + return ( +
+
+
+
+
+
+ {datas?.isActive && ( + Active - )} -
- -
- {hidden && ( -
- -
- )} -
-
-
- {/* title */} - -

- {datas.post_title} -

- -
-
- -
-
- -
-
-
+ )} +
+ {hidden &&
} +
- ); +
+ {/* title */} + +

+ {datas.post_title} +

+
+
+
+ +
+
+
+
+ ); } diff --git a/src/components/Resources/index.jsx b/src/components/Resources/index.jsx index 895e637..8e1fa4d 100644 --- a/src/components/Resources/index.jsx +++ b/src/components/Resources/index.jsx @@ -23,10 +23,10 @@ export default function Resources(props) { const __resources = props.MyResourceData; //debugger; // Collection Items - const collectionProducts = __resources?.collectiondata?.data; - const tab_categories = __resources?.tab_categories?.data; - const onSaleProducts = __resources?.marketdata?.data; const CreatedSell = __resources?.marketdata?.data; + const tab_categories = __resources?.tab_categories?.data; + const collectionProducts = __resources?.collectiondata?.data; + const onSaleProducts = __resources?.marketdata?.data; const CreatedBits = __resources?.productdata?.data; const blogItems = __resources?.blogdata?.payload; @@ -36,8 +36,6 @@ export default function Resources(props) { setTab(value); }; - console.log("first") - // Category Components const tabComponents = { blog: , @@ -56,7 +54,7 @@ export default function Resources(props) { activity: , }; - const defaultTabComponent = ; + const defaultTabComponent = ; const selectedTabComponent = tabComponents[tab] || defaultTabComponent; diff --git a/src/components/Resources/tabs/BlogTab.jsx b/src/components/Resources/tabs/BlogTab.jsx index 4b2845b..1f53174 100644 --- a/src/components/Resources/tabs/BlogTab.jsx +++ b/src/components/Resources/tabs/BlogTab.jsx @@ -47,7 +47,7 @@ export default function BlogTab({ className, blogdata }) { endLength={blogdata?.blogdata.length} > {({ datas }) => ( - + )}