From 1245130b0019e062ea21c361ce97b64705be8eb9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jun 2024 12:47:28 +0530 Subject: [PATCH] added comments and indentation --- src/Pages/BlogPage.jsx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Pages/BlogPage.jsx b/src/Pages/BlogPage.jsx index e5933c1..01ce712 100644 --- a/src/Pages/BlogPage.jsx +++ b/src/Pages/BlogPage.jsx @@ -87,9 +87,10 @@ const BlogPage = () => { }, // Add more blog objects as needed ]); + + /* Grouping blogs by tags and handling tab clicks. */ const blogsGroupedByTags = Object.groupBy(blogs, ({tag})=> tag) const handleTabClick = (e)=>{ - console.log(e.target.id) const previousActiveButton= document.querySelector(`#${activeTab + "Tab"}`) const previousActiveContainer = document.querySelector(`#${activeTab + "TabContainer"}`) const activeContainer = document.querySelector(`#${e.target.id + "Container"}`) @@ -107,28 +108,32 @@ const BlogPage = () => { } return ( <> -
+ {/* Tabs Container */} +
+ {/* Top blgs tab */}
+ {/* Trending blogs tab */}
+ {/* Latest blogs tab */}
-
-
-
- {blogsGroupedByTags[activeTab].map((blog)=> )} -
-
+
+
+
+ {blogsGroupedByTags[activeTab].map((blog)=> )} +
+
) }