From 00df30ea173afd527a37a8babc699a897ef98776 Mon Sep 17 00:00:00 2001 From: Srijan Dahal Date: Sat, 5 Jul 2025 23:33:49 +0545 Subject: [PATCH] srijan/Min --- frontend/src/app/components/Mentors/data.ts | 2 +- frontend/src/app/components/Navbar/Navbar.tsx | 4 +- .../app/{{organizers} => organizers}/page.tsx | 0 .../app/sections/Organizers/Organizers.tsx | 71 ++---- .../src/app/sections/Organizers/fetchTeams.ts | 59 ----- .../src/app/sections/Organizers/team_data.ts | 204 ++++++++++++++++++ .../sections/Volunteers/VolunteerSection.tsx | 8 +- frontend/src/app/sections/Volunteers/data.ts | 104 +-------- 8 files changed, 236 insertions(+), 216 deletions(-) rename frontend/src/app/{{organizers} => organizers}/page.tsx (100%) delete mode 100644 frontend/src/app/sections/Organizers/fetchTeams.ts create mode 100644 frontend/src/app/sections/Organizers/team_data.ts diff --git a/frontend/src/app/components/Mentors/data.ts b/frontend/src/app/components/Mentors/data.ts index b5dfd41..ca907f3 100644 --- a/frontend/src/app/components/Mentors/data.ts +++ b/frontend/src/app/components/Mentors/data.ts @@ -108,7 +108,7 @@ const Mentors_value: Mentors[] = [ }, { name: "Avinash Mishra", - position: "Senior Software Engineer", + position: "Lead Engineer", linkedin_url: "https://www.linkedin.com/in/avinash-mishra-np/", // No LinkedIn URL provided image: "https://ghostuf.github.io/static_images/avinash_mishra.png" }, diff --git a/frontend/src/app/components/Navbar/Navbar.tsx b/frontend/src/app/components/Navbar/Navbar.tsx index 1773b44..ae4c4e3 100644 --- a/frontend/src/app/components/Navbar/Navbar.tsx +++ b/frontend/src/app/components/Navbar/Navbar.tsx @@ -154,7 +154,7 @@ const Navbar = () => { - {/* Organizers */} + Organizers {/* @@ -223,7 +223,7 @@ const Navbar = () => { - {/* Organizers */} + Organizers {/* diff --git a/frontend/src/app/{organizers}/page.tsx b/frontend/src/app/organizers/page.tsx similarity index 100% rename from frontend/src/app/{organizers}/page.tsx rename to frontend/src/app/organizers/page.tsx diff --git a/frontend/src/app/sections/Organizers/Organizers.tsx b/frontend/src/app/sections/Organizers/Organizers.tsx index b1fc902..367034c 100644 --- a/frontend/src/app/sections/Organizers/Organizers.tsx +++ b/frontend/src/app/sections/Organizers/Organizers.tsx @@ -1,13 +1,12 @@ -import { ReactElement } from "react"; -import getData from "./fetchTeams"; -import Team from "@/app/types/team"; -import Image from "next/image"; +// app/components/Organizers.tsx + +import teamsData from "./team_data"; // ⬅️ Now from static file import UserCard from "@/app/components/core/UserCard"; -import { cabinetBold, cabinetExtraBold, cabinetBlack } from "@/app/utils/fonts"; +import { cabinetExtraBold } from "@/app/utils/fonts"; import VolunteerSection from "../Volunteers/VolunteerSection"; -export default async function Organizers() { - const teams: Array = await getData(); +export default function Organizers() { + const teams = teamsData; return (
@@ -16,57 +15,31 @@ export default async function Organizers() { > Meet The Organizers - {teams.map((team: Team, key = team.id) => ( + + {teams.map((team) => (
-

+

{team.name}

-
- {team.organizers.length === 2 ? ( -
- {team.organizers.map((organizer, index) => ( - - ))} -
- ) : ( -
- {team.organizers.map((organizer, index) => - index == 0 ? ( -
- -
- ) : ( - - ), - )} + +
+ {team.organizers.map((organizer, index) => ( +
+
- )} + ))}
))} -
+ +

Volunteers

diff --git a/frontend/src/app/sections/Organizers/fetchTeams.ts b/frontend/src/app/sections/Organizers/fetchTeams.ts deleted file mode 100644 index ea969aa..0000000 --- a/frontend/src/app/sections/Organizers/fetchTeams.ts +++ /dev/null @@ -1,59 +0,0 @@ -import UserEntity from "@/app/types/userentity"; -import { BACKEND_URL, SERVER_URL } from "@/app/utils/config"; - -import Team from "@/app/types/team"; - -function transformData(data: any): Array { - let teams: Array = []; - - for (let team of data.data) { - let member: UserEntity = { - name: "", - image: "", - linkedin_url: "", - position: "", - }; - - const members: Array = []; - - for (let value of team.attributes.organizers.data) { - member = { - id: value.attributes.id, - name: value.attributes.name, - image: SERVER_URL + value.attributes.image.data.attributes.url, - linkedin_url: value.attributes.linkedin_url, - position: "", - }; - members.push(member); - } - - let teamInstance: Team = { - id: team.id, - name: team.attributes.name, - organizers: members, - }; - - teams.push(teamInstance); - } - return teams; -} - -async function getData() { - try { - const res = await fetch( - "http://localhost:1337/api/teams?populate=organizers&populate=organizers.image&sort=order:asc", - { cache: "no-store" }, - ); - if (!res.ok) { - throw new Error("Cannot Fetch Data"); - } - const data = await res.json(); - const teams = transformData(data); - return teams; - } catch (error: any) { - console.log("Error", error.message); - return []; - } -} - -export default getData; diff --git a/frontend/src/app/sections/Organizers/team_data.ts b/frontend/src/app/sections/Organizers/team_data.ts new file mode 100644 index 0000000..2515ff6 --- /dev/null +++ b/frontend/src/app/sections/Organizers/team_data.ts @@ -0,0 +1,204 @@ +// app/lib/data.ts + +import Team from "@/app/types/team"; + +const teamsData: Array = [ + { + id: 1, + name: "Event Co-leads", + organizers: [ + { + id: 101, + name: "Dipan Silwal", + image: "https://ghostuf.github.io/static_images/oc/dipan_silwal.jpg", + linkedin_url: "https://www.linkedin.com/in/dipansilwal/", + position: "Event Co-lead", + }, + { + id: 102, + name: "Pragalva Sapkota", + image: "https://ghostuf.github.io/static_images/oc/pragalva_sapkota.jpg", + linkedin_url: "https://www.linkedin.com/in/pragalva-sapkota/", + position: "Event Co-lead", + }, + ], + }, + { + id: 2, + name: "Technical Team", + organizers: [ + { + id: 201, + name: "Srijan Dahal", + image: "https://ghostuf.github.io/static_images/oc/srijan_dahal.jpg", + linkedin_url: "https://www.linkedin.com/in/srijan-dahal-b532aa26b/", + position: "Technical Team", + }, + { + id: 202, + name: "Suprit Phuyal", + image: "https://ghostuf.github.io/static_images/oc/suprit_phuyal.jpg", + linkedin_url: "https://www.linkedin.com/in/suprit-phuyal-225a7a2a7/", + position: "Technical Team", + }, + ], + }, + { + id: 3, + name: "Design Team", + organizers: [ + { + id: 301, + name: "Parth Poudyal", + image: "https://ghostuf.github.io/static_images/oc/parth_poudyal.jpg", + linkedin_url: "https://www.linkedin.com/in/parth-poudyal-79a56b2b9/", + position: "Design Team", + }, + { + id: 302, + name: "Paruhangma Limbu", + image: "https://ghostuf.github.io/static_images/oc/paruhangma_limbu.jpg", + linkedin_url: "https://www.linkedin.com/in/paruhangmalimbu", + position: "Design Team", + }, + { + id: 303, + name: "Aashish Sapkota", + image: "https://ghostuf.github.io/static_images/oc/aashish_sapkota.png", + linkedin_url: "https://www.linkedin.com/in/aashish-sapkota-aa66a22a7/", + position: "Design Team", + + } + ], + }, + { + id: 4, + name: "Judges and Mentor Coordinator", + organizers: [ + { + id: 401, + name: "Yashaswi Shiwakoti", + image: "https://ghostuf.github.io/static_images/oc/yashaswi_shiwakoti.png", + linkedin_url: "https://www.linkedin.com/in/yashaswi-shiwakoti-09a6012a2/", + position: "Judges and Mentor Coordinator", + }, + { + id: 402, + name: "Sakshi Sapkota", + image: "https://ghostuf.github.io/static_images/oc/sakshi_sapkota.PNG", + linkedin_url: "https://www.linkedin.com/in/sakshi-sapkota-316647328/", + position: "Judges and Mentor Coordinator", + }, + ], + }, + { + id: 5, + name: "PR and Social Media", + organizers: [ + { + id: 501, + name: "Ishan Shrestha", + image: "https://ghostuf.github.io/static_images/oc/ishan_shrestha.jpg", + linkedin_url: "https://www.linkedin.com/in/ishan-shrestha-5635b42b1/", + position: "PR and Social Media", + }, + { + id: 502, + name: "Sukriti Pyakurel", + image: "https://ghostuf.github.io/static_images/oc/sukriti_pyakurel.jpg", + linkedin_url: "https://www.linkedin.com/in/sukriti-pyakurel-05b0132ba/", + position: "PR and Social Media", + }, + ], + }, + { + id: 6, + name: "Logistics", + organizers: [ + { + id: 601, + name: "Prajwol Bohara", + image: "https://ghostuf.github.io/static_images/oc/prajwol_bohara.jpeg", + linkedin_url: "https://www.linkedin.com/in/prajwol-bohara-132aab2b1/", + position: "Logistics", + }, + { + id: 602, + name: "Rupesh Thapa", + image: "https://ghostuf.github.io/static_images/oc/rupesh_thapa.jpg", + linkedin_url: "", + position: "Logistics", + }, + { + id: 603, + name: "Shivank Poudel", + image: "https://ghostuf.github.io/static_images/oc/shivank_poudel.jpg", + linkedin_url: "https://www.linkedin.com/in/shivank-poudel-6a8677263/", + position: "Logistics", + }, + { + id: 604, + name: "Kaustuv Shrestha", + image: "https://ghostuf.github.io/static_images/oc/kaustuv_shrestha.jpeg", + linkedin_url: "https://www.linkedin.com/in/kaustuv-shrestha-42b3482a8", + position: "Logistics", + }, + ], + }, + { + id: 7, + name: "Documentation", + organizers: [ + { + id: 701, + name: "Anbit Bhattrai", + image: "https://ghostuf.github.io/static_images/oc/anbit_bhattrai.png", + linkedin_url: "https://www.linkedin.com/in/anbit-bhattarai-518377370/", + position: "Documentation", + }, + ], + }, + { + id: 8, + name: "Outreach Team", + organizers: [ + { + id: 801, + name: "Pranil Parsai", + image: "https://ghostuf.github.io/static_images/oc/pranil_parsai.jpg", + linkedin_url: "www.linkedin.com/in/pranil-prasai-98b72a2b3", + position: "Outreach Team", + }, + { + id: 802, + name: "Abhinav Bista", + image: "https://ghostuf.github.io/static_images/oc/abhinav_bista.jpeg", + linkedin_url: "http://linkedin.com/in/abhinav-bista-21ba7b2a7", + position: "Outreach Team", + }, + { + id: 803, + name: "Arunesh Manandhar", + image: "https://ghostuf.github.io/static_images/oc/arunesh_manandhar.jpg", + linkedin_url: "https://www.linkedin.com/in/arunesh-manandhar-5bb207362/", + position: "Outreach Team", + }, + { + id: 804, + name: "Sampriya Bista", + image: "https://ghostuf.github.io/static_images/oc/sampriya_bista.png", + linkedin_url: "", + position: "Outreach Team", + }, + { + id: 805, + name: "Samyam Khadka", + image: "https://ghostuf.github.io/static_images/oc/samyam_khadka.png", + linkedin_url: "https://www.linkedin.com/in/samyam-khadka-0361b62a6/", + position: "Outreach Team", + }, + ], + }, +]; + +export default teamsData; \ No newline at end of file diff --git a/frontend/src/app/sections/Volunteers/VolunteerSection.tsx b/frontend/src/app/sections/Volunteers/VolunteerSection.tsx index 161fd27..ae3204d 100644 --- a/frontend/src/app/sections/Volunteers/VolunteerSection.tsx +++ b/frontend/src/app/sections/Volunteers/VolunteerSection.tsx @@ -1,12 +1,14 @@ import UserEntity from "@/app/types/userentity"; -import volunteerFetcher from "./data"; +// import volunteerFetcher from "./data"; import UserCard from "@/app/components/core/UserCard"; +import { Volunteers_value } from "./data"; + const VolunteerSection = async () => { - const volunteers = await volunteerFetcher(); + // const volunteers = await volunteerFetcher(); return (
- {volunteers.map((volunteer: UserEntity) => ( + {Volunteers_value.map((volunteer: UserEntity) => (