made blog component to show first when resources link is hit
This commit was merged in pull request #235.
This commit is contained in:
@@ -4,76 +4,75 @@ import { toast } from "react-toastify";
|
|||||||
import localImgLoad from "../../lib/localImgLoad";
|
import localImgLoad from "../../lib/localImgLoad";
|
||||||
import Icons from "../Helpers/Icons";
|
import Icons from "../Helpers/Icons";
|
||||||
|
|
||||||
|
import Image from '../../assets/images/Linkedin.png'
|
||||||
|
|
||||||
export default function ProductCardStyleTwo({
|
export default function ProductCardStyleTwo({
|
||||||
className,
|
className,
|
||||||
datas,
|
datas,
|
||||||
hidden = false,
|
hidden = false,
|
||||||
}) {
|
bg
|
||||||
// debugger;
|
}) {
|
||||||
const [addFavorite, setValue] = useState(datas.whishlisted);
|
// debugger;
|
||||||
const [options, setOption] = useState(false);
|
const [addFavorite, setValue] = useState(datas.whishlisted);
|
||||||
const favoriteHandler = () => {
|
const [options, setOption] = useState(false);
|
||||||
if (!addFavorite) {
|
const favoriteHandler = () => {
|
||||||
setValue(true);
|
if (!addFavorite) {
|
||||||
toast.success("Added to Favorite List");
|
setValue(true);
|
||||||
} else {
|
toast.success("Added to Favorite List");
|
||||||
setValue(false);
|
} else {
|
||||||
toast.warn("Remove to Favorite List");
|
setValue(false);
|
||||||
}
|
toast.warn("Remove to Favorite List");
|
||||||
};
|
}
|
||||||
return (
|
};
|
||||||
<div
|
|
||||||
className={`card-style-two w-full h-[336px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
return (
|
||||||
className || ""
|
<div
|
||||||
}`}
|
className={`card-style-two w-full h-[336px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
||||||
>
|
className || ""
|
||||||
<div className="flex flex-col justify-between w-full h-full">
|
}`}
|
||||||
<div className="thumbnail-area w-full">
|
>
|
||||||
<div
|
<div className="flex flex-col justify-between w-full h-full">
|
||||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
|
<div className="thumbnail-area w-full">
|
||||||
style={{
|
<div
|
||||||
background: `url(${`https://blog.float.sg/wp-content/uploads/${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
|
||||||
}}
|
style={{
|
||||||
>
|
background: `url(${`https://blog.wrenchboard.com/wp-content/uploads/${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
||||||
<div className="product-two-options flex justify-between mb-5 relative">
|
// background: `url(${`${bg}${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
||||||
<div className="status">
|
}}
|
||||||
{datas?.isActive && (
|
>
|
||||||
<span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">
|
<div className="product-two-options flex justify-between mb-5 relative">
|
||||||
|
<div className="status">
|
||||||
|
{datas?.isActive && (
|
||||||
|
<span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">
|
||||||
Active
|
Active
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
{hidden && (
|
|
||||||
<div className="flex justify-center">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="details-area">
|
|
||||||
{/* title */}
|
|
||||||
<Link to="/shop-details" className="mb-2.5">
|
|
||||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
|
||||||
{datas.post_title}
|
|
||||||
</h1>
|
|
||||||
</Link>
|
|
||||||
<div className="flex justify-between">
|
|
||||||
<div className="flex items-center space-x-2">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
|
|
||||||
>
|
|
||||||
View
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
{hidden && <div className="flex justify-center"></div>}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
<div className="details-area">
|
||||||
|
{/* title */}
|
||||||
|
<a href={datas.guid} target="_blank" className="mb-2.5">
|
||||||
|
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||||
|
{datas.post_title}
|
||||||
|
</h1>
|
||||||
|
</a>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<div className="flex items-center space-x-2"></div>
|
||||||
|
<div className="my-1">
|
||||||
|
<a
|
||||||
|
href={datas.guid}
|
||||||
|
target="_blank"
|
||||||
|
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
|
||||||
|
>
|
||||||
|
View
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ export default function Resources(props) {
|
|||||||
const __resources = props.MyResourceData;
|
const __resources = props.MyResourceData;
|
||||||
//debugger;
|
//debugger;
|
||||||
// Collection Items
|
// 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 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 CreatedBits = __resources?.productdata?.data;
|
||||||
const blogItems = __resources?.blogdata?.payload;
|
const blogItems = __resources?.blogdata?.payload;
|
||||||
|
|
||||||
@@ -36,8 +36,6 @@ export default function Resources(props) {
|
|||||||
setTab(value);
|
setTab(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("first")
|
|
||||||
|
|
||||||
// Category Components
|
// Category Components
|
||||||
const tabComponents = {
|
const tabComponents = {
|
||||||
blog: <BlogTab blogdata={blogItems} />,
|
blog: <BlogTab blogdata={blogItems} />,
|
||||||
@@ -56,7 +54,7 @@ export default function Resources(props) {
|
|||||||
activity: <ActivitiesTab />,
|
activity: <ActivitiesTab />,
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultTabComponent = <OnSaleTab products={onSaleProducts} />;
|
const defaultTabComponent = <BlogTab blogdata={blogItems} />;
|
||||||
|
|
||||||
const selectedTabComponent = tabComponents[tab] || defaultTabComponent;
|
const selectedTabComponent = tabComponents[tab] || defaultTabComponent;
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export default function BlogTab({ className, blogdata }) {
|
|||||||
endLength={blogdata?.blogdata.length}
|
endLength={blogdata?.blogdata.length}
|
||||||
>
|
>
|
||||||
{({ datas }) => (
|
{({ datas }) => (
|
||||||
<ResourceBlogCard key={datas.id} datas={datas} />
|
<ResourceBlogCard key={datas.id} datas={datas} bg={blogdata.image_url} />
|
||||||
)}
|
)}
|
||||||
</DataIteration>
|
</DataIteration>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user