diff --git a/src/APP/pages/blog/sections/RelatedBlogs.jsx b/src/APP/pages/blog/sections/RelatedBlogs.jsx index 04ea6083..b669aca9 100644 --- a/src/APP/pages/blog/sections/RelatedBlogs.jsx +++ b/src/APP/pages/blog/sections/RelatedBlogs.jsx @@ -29,22 +29,27 @@ function RelatedBlogs({ blogId, categoryId }) { {isError &&

Error loading blogs!

} {isLoading &&

Loading blogs...

} - {isSuccess && ( -
- {Array.isArray(filteredRelatedBlogs) && - filteredRelatedBlogs.length > 0 ? ( - filteredRelatedBlogs.filter(function(blog){ - if(blog.id === blogId ) { - return false; - } - return true; - }).map((blog) => ( - - )) - ) : ( -

No related blogs found!

- )} -
+ {isSuccess && filteredRelatedBlogs.length > 0 && ( + <> +

+ Related Blogs +

+
+ {Array.isArray(filteredRelatedBlogs) && + filteredRelatedBlogs.length > 0 ? ( + filteredRelatedBlogs + .filter(function (blog) { + if (blog.id === blogId) { + return false; + } + return true; + }) + .map((blog) => ) + ) : ( +

No related blogs found!

+ )} +
+ )} ); diff --git a/src/APP/pages/blogs/sections/BlogsWrapper.jsx b/src/APP/pages/blogs/sections/BlogsWrapper.jsx index ea14eb14..802a92ea 100644 --- a/src/APP/pages/blogs/sections/BlogsWrapper.jsx +++ b/src/APP/pages/blogs/sections/BlogsWrapper.jsx @@ -19,7 +19,9 @@ function SearchResults({ searchText }) { return (

Showing results for - "{searchText}" + + "{searchText}" +

); } @@ -30,8 +32,6 @@ function BlogsWrapper() { const [selectedCat, setSelectedCat] = useState(""); const [page, setPage] = useState(1); - const navigate = useNavigate(); - const { data: blogsData, refetch: refetchBlogsData, @@ -66,7 +66,7 @@ function BlogsWrapper() { return (
- {isError && navigate("/error-500")} + {isError && } {isLoading && (