>
+ >
);
};
diff --git a/src/app/blogs/page.js b/src/app/blogs/page.js
index d021ced..f403677 100644
--- a/src/app/blogs/page.js
+++ b/src/app/blogs/page.js
@@ -1,35 +1,3 @@
-/*import BlogCard from './Blogcard';
-import Navbar from "@/components/Navbar/Navbar";
-
-const BlogList = () => {
- return (
-
- );
-};
-
-export default BlogList;*/
-
"use client"
import React, { useEffect, useState } from 'react';
import BlogCard from './Blogcard';
@@ -75,22 +43,29 @@ const BlogList = () => {
return (
<>
-
- {blogs.map((blog, index) => {
- return (
- <>
-
- >
- )
- })}
+
+
+
+ {blogs.map((blog, index) => {
+ return (
+ <>
+
+ >
+ )
+ })}
+
>
);
diff --git a/src/app/events/Eventcard.module.css b/src/app/events/Eventcard.module.css
index 008fa8f..ab2bbfc 100644
--- a/src/app/events/Eventcard.module.css
+++ b/src/app/events/Eventcard.module.css
@@ -16,7 +16,7 @@
}
.blogCard {
- width: 350px;
+ width: 320px;
height: fit-content;
border: 1px solid #e0e0e0;
border-radius: 8px;
@@ -29,6 +29,12 @@
height: 100%;
}
+@media screen and (max-width: 350px) {
+ .blogCard {
+ width: 100%;
+ }
+}
+
.blogCcard:hover {
transform: scale(1.02);
}
diff --git a/src/app/events/[blogid]/page.js b/src/app/events/[blogid]/page.js
deleted file mode 100644
index ff4d631..0000000
--- a/src/app/events/[blogid]/page.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// Import necessary modules
-"use client"
-import { useEffect, useState } from "react";
-import Navbar from "@/components/Navbar/Navbar";
-import Footer from "@/components/footer";
-import ReactMarkdown from "react-markdown";
-import './styleblog.css'
-// Import Tailwind CSS classes
-import 'tailwindcss/tailwind.css';
-
-// Component definition
-const BlogId = ({ params }) => {
- console.log(params.blogid)
- // State to store the fetched data
- const [blogData, setBlogData] = useState(null);
-
- // Effect to fetch data when the component mounts
- useEffect(() => {
- const fetchData = async () => {
- try {
- // Fetch data from the API
- const response = await fetch('https://tetragram.codered.cloud/api/v2/pages/?type=blog.BlogPage&fields=*');
- const data = await response.json();
- console.log("check",data);
- // Find the blog post with the matching id
- const matchingBlog = data.items.find(blog => blog.id === parseInt(params.blogid));
-
- // Update the state with the matching blog data
- setBlogData(matchingBlog);
- console.log("blog :",matchingBlog.blog_img_url)
-
- } catch (error) {
- console.error('Error fetching data:', error);
- }
- };
-
- // Call the fetchData function
- fetchData();
- }, [params.id]); // Include params.id in the dependency array to refetch data when id changes
-
- // Render the component
- return (
- <>
-
-
-
-
- {blogData ? (
-
-
{blogData.title}
- {blogData.blog_body}
-
- ) : (
-
Loading...
- )}
-
-
-
>
- );
-};
-
-// Export the component
-export default BlogId;
diff --git a/src/app/events/[eventid]/page.js b/src/app/events/[eventid]/page.js
new file mode 100644
index 0000000..910d194
--- /dev/null
+++ b/src/app/events/[eventid]/page.js
@@ -0,0 +1,88 @@
+// Import necessary modules
+"use client"
+import { useEffect, useState } from "react";
+import Navbar from "@/components/Navbar/Navbar";
+import Footer from "@/components/footer";
+import ReactMarkdown from "react-markdown";
+import './styleblog.css'
+// Import Tailwind CSS classes
+import 'tailwindcss/tailwind.css';
+
+// Component definition
+const BlogId = ({ params }) => {
+ console.log(params.blogid)
+ // State to store the fetched data
+ const [eventData, setEventData] = useState(null);
+
+ // Effect to fetch data when the component mounts
+ useEffect(() => {
+ const fetchData = async () => {
+ try {
+ // Fetch data from the API
+ const response = await fetch('https://tetragram.codered.cloud/api/v2/pages/?type=events.EventsPage&fields=*');
+ const data = await response.json();
+ // Find the blog post with the matching id
+ const matchingBlog = data.items.find(blog => blog?.meta.slug === params.eventid);
+ // Update the state with the matching blog data
+ setEventData(matchingBlog);
+
+ } catch (error) {
+ console.error('Error fetching data:', error);
+ }
+ };
+
+ // Call the fetchData function
+ fetchData();
+ }, [params.blogid]); // Include params.id in the dependency array to refetch data when id changes
+ console.log(eventData?.event_tags.split(","))
+
+ let inputDate = eventData?.event_date;
+ let dateObj = new Date(inputDate);
+ let day = dateObj.getDate();
+ let month = dateObj.toLocaleString('default', { month: 'short' });
+ let year = dateObj.getFullYear();
+
+ let formattedDate = `${day} ${month} ${year}`;
+
+ // Render the component
+ return (
+ <>
+
+
+
+ {eventData ? (
+
+
+
+
+ {eventData?.event_tags.split(",").map((data, index) => {
+ return (
+ {data}
+ )
+ }
+ )}
+
+
+ {eventData.title}
+
+
+
+
+
+ {eventData.event_organizer}{formattedDate}
+
+
+
+
{eventData.event_body}
+
+ ) : (
+
Loading...
+ )}
+
+
+ >
+ );
+};
+
+// Export the component
+export default BlogId;
diff --git a/src/app/events/[blogid]/styleblog.css b/src/app/events/[eventid]/styleblog.css
similarity index 100%
rename from src/app/events/[blogid]/styleblog.css
rename to src/app/events/[eventid]/styleblog.css
diff --git a/src/app/events/eventCard.js b/src/app/events/eventCard.js
index 6627fac..fa0b2d7 100644
--- a/src/app/events/eventCard.js
+++ b/src/app/events/eventCard.js
@@ -10,17 +10,19 @@ const BlogCard = ({ title, img, description, slug, date }) => {
// const truncatedDescription = description.length > 100 ? `${description.slice(0, 100)}...` : description;
return (
-
-
-
+
+
+
+
+
+
+
{title}
+
{" "} {date}
+
{" "} SJA
+
{description.slice(0, 150) + "... see more"}
+
-
-
{title}
-
{" "} {date}
-
{" "} SJA
-
{description.slice(0, 150) + "... see more"}
-
-
+
);
};
diff --git a/src/app/events/page.js b/src/app/events/page.js
index b634039..b9dfc1f 100644
--- a/src/app/events/page.js
+++ b/src/app/events/page.js
@@ -1,18 +1,8 @@
"use client"
import React, { useEffect, useState } from 'react';
import BlogCard from './eventCard';
-import Footer from '@/components/footer';
-import Navbar from "@/components/Navbar/Navbar";
-import {
- Card,
- CardContent,
- CardDescription,
- CardFooter,
- CardHeader,
- CardTitle,
-} from '@/components/ui/card';
-const BlogList = () => {
+const EventList = () => {
const [blogs, setBlogs] = useState([]);
const [currentPage, setCurrentPage] = useState(1);
const blogsPerPage = 6;
@@ -43,25 +33,32 @@ const BlogList = () => {
return (
<>
-
- {blogs.map((blog, index) => {
- return (
- <>
-
- >
- )
- })}
+
+
+
+ {blogs.map((blog, index) => {
+ return (
+ <>
+
+ >
+ )
+ })}
+
>
);
};
-export default BlogList;
+export default EventList;
diff --git a/src/app/globals.css b/src/app/globals.css
index 61c7511..e717c0e 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -7,7 +7,7 @@
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
--header-height: 1rem;
- --first-color: hsl(28, 88%, 62%);
+ --first-color: hsl(4, 50%, 21%);
--title-color: hsl(290, 66%, 39%);
--text-color: hsl(291, 52%, 37%);
--body-color: hsl(0, 0%, 6%);
diff --git a/src/app/iet/page.js b/src/app/iet/page.js
index d4aa1e5..b4dc40b 100644
--- a/src/app/iet/page.js
+++ b/src/app/iet/page.js
@@ -15,7 +15,6 @@ export default function Home() {
-
>
)
}
\ No newline at end of file
diff --git a/src/app/layout.js b/src/app/layout.js
index 6605fbb..eb232af 100644
--- a/src/app/layout.js
+++ b/src/app/layout.js
@@ -1,6 +1,7 @@
import Navbar from '@/components/Navbar/Navbar'
import './globals.css'
import { Inter } from 'next/font/google'
+import Footer from '@/components/footer'
const inter = Inter({ subsets: ['latin'] })
@@ -16,6 +17,7 @@ export default function RootLayout({ children }) {
{children}
+