mirror of
https://github.com/WDI-Ideas/rubix.git
synced 2026-04-28 20:45:50 +00:00
Created route for blogposts
This commit is contained in:
@@ -16,6 +16,7 @@ import fb from "../../assets/images/fb.png";
|
||||
import { useGetBlogQuery } from "../../Redux/slice/blogsSlice";
|
||||
import { Link, useParams } from "react-router-dom";
|
||||
import NotFound from "../../pages/NotFound";
|
||||
import Loader from "../Loader/Loader";
|
||||
|
||||
const BlogPost = () => {
|
||||
const { title_slug } = useParams();
|
||||
@@ -28,7 +29,11 @@ const BlogPost = () => {
|
||||
}, []);
|
||||
|
||||
if (isLoading) {
|
||||
return <div>Loading...</div>;
|
||||
return (
|
||||
<div>
|
||||
<Loader />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const matchingBlogPost = blogPosts
|
||||
|
||||
@@ -8,13 +8,10 @@ import { Link, useParams } from "react-router-dom";
|
||||
import { useGetBlogQuery } from "../../Redux/slice/blogsSlice";
|
||||
|
||||
const HomeCard = ({ cardkey, date, text, link }) => {
|
||||
const { title_slug } = useParams();
|
||||
const { data } = useGetBlogQuery();
|
||||
const blogCards = data?.data;
|
||||
|
||||
const matchingBlogPost = blogCards
|
||||
? blogCards.find((item) => item.title_slug === title_slug)
|
||||
: null;
|
||||
console.log(blogCards);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -94,7 +91,7 @@ const HomeCard = ({ cardkey, date, text, link }) => {
|
||||
WebkitLineClamp: 2,
|
||||
}}
|
||||
>
|
||||
{card.meta_description}
|
||||
{card.title}
|
||||
</Text>
|
||||
<Box
|
||||
display={"flex"}
|
||||
|
||||
@@ -101,7 +101,7 @@ const MobileFooter = () => {
|
||||
color={"#B0B0B0"}
|
||||
fontFamily={"Mona Sans"}
|
||||
fontWeight={"500"}
|
||||
fontSize={"22px"}
|
||||
fontSize={"16px"}
|
||||
>
|
||||
Social
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user