diff --git a/src/components/home/Blogs.tsx b/src/components/home/Blogs.tsx index 3439b0a8..69ce9cb9 100644 --- a/src/components/home/Blogs.tsx +++ b/src/components/home/Blogs.tsx @@ -60,9 +60,8 @@ const BlogCard = ({ blog }: { blog: Blog }) => (

{blog.title}

-

- {blog.content} -

+
+
diff --git a/src/pages/Blogs/Blogs.tsx b/src/pages/Blogs/Blogs.tsx index 1dcf920e..e0bc8330 100644 --- a/src/pages/Blogs/Blogs.tsx +++ b/src/pages/Blogs/Blogs.tsx @@ -51,89 +51,107 @@ const Blogs: React.FC = () => { )} {loading ? ( -
-
- Loading... -
-
+
+
+ Loading... +
+
) : blogs.length > 0 ? ( <> -
+
{blogs.map((blog) => ( -
- - {blog.title} - -
-
-
- -
- - {blog.author.firstname} - - - - {blog.created_at - ? new Date(Number(blog.created_at)).toLocaleDateString() - : "Unknown Date"} - - - {blog.reactions.length || 0} - - - {blog.comments.length || 0} - -
- -
-
- -

{blog.title}

-

- {blog.content.substring(0, 150)}... -

- -
- {blog.tags.map((tag) => ( - { - setSelectedTag(tag); - }} - className="bg-green-100 text-green-700 text-xs px-2 py-1 rounded cursor-pointer hover:bg-green-200" - > - #{tag} - - ))} -
-
- -
- +
+ + {blog.title} + +
+
+
+ +
+ + {" "} + {blog.author.firstname} + + + + {blog.created_at + ? new Date( + Number(blog.created_at) + ).toLocaleDateString() + : "Unknown Date"} + + + {" "} + {blog.reactions.length || 0} + + + {" "} + {blog.comments.length || 0} + +
+ +
+
+ +

+ {blog.title} +

+
+ +
+ {blog.tags.map((tag) => ( + { + setSelectedTag(tag); + }} + className="bg-green-100 text-green-700 text-xs px-2 py-1 rounded cursor-pointer hover:bg-green-200" + > + #{tag} + + ))} +
+
+
))}
- - + ) : (
- - - -

No blogs available at the moment. Check back later!

-
+ + + +

+ No blogs available at the moment. Check back later! +

+
)}