Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions components/Contact/ContactForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState } from "react";
import axios from "axios";
import { ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import { API_ENDPOINTS } from '@/utils/config';

function ContactForm() {
const [formData, setFormData] = useState({
Expand Down Expand Up @@ -97,7 +98,7 @@ function ContactForm() {
});

axios
.post("/api/v1/contact", {
.post(API_ENDPOINTS.CONTACT.SEND_MESSAGE, {
name: formData.name.trim(),
email: formData.email.trim(),
message: formData.message.trim()
Expand Down Expand Up @@ -230,8 +231,8 @@ function ContactForm() {
onClick={handleSubmit}
disabled={!isFormValid() || isSubmitting}
className={`text-black bg-bright_green font-dmSans font-bold text-md md:text-lg rounded-full py-3 md:py-4 px-4 w-[40%] my-6 mx-auto transition-opacity ${!isFormValid() || isSubmitting
? "opacity-50 cursor-not-allowed"
: "hover:bg-opacity-90"
? "opacity-50 cursor-not-allowed"
: "hover:bg-opacity-90"
}`}
>
{isSubmitting ? "Submitting..." : "Submit"}
Expand Down
21 changes: 13 additions & 8 deletions components/Home/Sponsors.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import React from 'react';
import { useEffect, useState } from "react";
// const sponsors = [
// { name: "SWOC", logo: "https://res.cloudinary.com/doslhy0tq/image/upload/v1729971260/SWOC_mfzb98.png" },
// { name: "Linux Foundation", logo: "https://www.linuxfoundation.org/hubfs/lf-stacked-color.svg" },
// { name: "Genxyz", logo: "https://res.cloudinary.com/doslhy0tq/image/upload/v1729540377/xyz-logo-color_mrldu1.svg" }
// ];
import { API_ENDPOINTS } from '@/utils/config';

const Sponsors = () => {
const [sponsors, setSponsors] = useState([]);
Expand All @@ -14,12 +10,21 @@ const Sponsors = () => {
const fetchSponsors = async () => {
try {
setLoading(true);
const response = await fetch("../api/v1/sponsers");
const response = await fetch(API_ENDPOINTS.SPONSORS.GET_ALL);
const result = await response.json();
console.log("hello")
setSponsors(result.data);

// Handle different response structures
if (result.success && result.data) {
setSponsors(result.data);
} else if (Array.isArray(result)) {
setSponsors(result);
} else {
console.error("Unexpected response format:", result);
setSponsors([]);
}
} catch (error) {
console.error("Error fetching sponsors:", error);
setSponsors([]);
} finally {
setLoading(false);
}
Expand Down
2 changes: 1 addition & 1 deletion components/Shared/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Navbar = () => {
src="logo.png"
className="h-8 md:h-10 cursor-pointer"
onClick={() =>
(window.location.href = "https://githubsrmist.tech/")
(window.location.href = "https://githubsrmist.in/")
}
/>
<ul className="hidden md:flex space-x-6">
Expand Down
2 changes: 1 addition & 1 deletion next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
siteUrl: 'https://githubsrmist.tech',
siteUrl: 'https://githubsrmist.in',
generateRobotsTxt: true,
};
16 changes: 8 additions & 8 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function MyApp({ Component, pageProps }) {
<meta name="google-site-verification" content="google-site-verification= " />
<meta property="og:site_name" content="GitHub Community SRM - The Official student-led community affiliated with GitHub, spearheading the open-source revolution at SRMIST." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://githubsrmist.tech" />
<link rel="canonical" href="https://githubsrmist.tech" />
<meta property="og:url" content="https://githubsrmist.in" />
<link rel="canonical" href="https://githubsrmist.in" />

<meta property="image" content="../public/favicon.ico" />
<meta
Expand Down Expand Up @@ -73,14 +73,14 @@ function MyApp({ Component, pageProps }) {
<meta property="og:site_name" content="GitHub Community SRM" />
<meta property="og:title" content="GitHub Community SRMIST | Open Source at SRMIST" />
<meta property="og:description" content="GitHub Community SRM is the student-led open-source community at SRM Institute of Science and Technology." />
<meta property="og:url" content="https://githubsrmist.tech" />
<meta property="og:url" content="https://githubsrmist.in" />
<meta property="og:image" content="/public/Logo.png" />
<meta property="og:type" content="website" />
<meta property="og:see_also" content="https://github.com/SRM-IST-KTR" />
<meta property="og:see_also" content="https://www.instagram.com/githubsrm/" />
<meta property="og:see_also" content="https://www.linkedin.com/company/githubsrm" />

<link rel="canonical" href="https://githubsrmist.tech" />
<link rel="canonical" href="https://githubsrmist.in" />

<link rel="icon" href="/favicon.ico" />

Expand All @@ -91,13 +91,13 @@ function MyApp({ Component, pageProps }) {
"@context": "https://schema.org",
"@type": "Organization",
"name": "GitHub Community SRM",
"url": "https://githubsrmist.tech",
"logo": "https://githubsrmist.tech/logo.png",
"url": "https://githubsrmist.in",
"logo": "https://githubsrmist.in/logo.png",
"contactPoint": {
"@type": "ContactPoint",
"email": "community@githubsrmist.tech",
"email": "community@githubsrmist.in",
"contactType": "Customer Support",
"url": "https://githubsrmist.tech/contact"
"url": "https://githubsrmist.in/contact"
},
"sameAs": [
"https://www.instagram.com/githubsrm/",
Expand Down
6 changes: 3 additions & 3 deletions pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function AboutUs() {
/>
<link
rel="canonical"
href="https://githubsrmist.tech/about"
href="https://githubsrmist.in/about"
/>

<meta name="twitter:card" content="/public/logo.png" />
Expand All @@ -50,7 +50,7 @@ function AboutUs() {
<meta name="twitter:site" content="@GithubSrm" />
<meta
name="twitter:url"
content="https://githubsrmist.tech/about"
content="https://githubsrmist.in/about"
/>

<meta
Expand All @@ -63,7 +63,7 @@ function AboutUs() {
/>
<meta
property="og:url"
content="https://githubsrmist.tech/about"
content="https://githubsrmist.in/about"
/>
<meta property="og:image" content="/public/logo.png" />
<meta property="og:type" content="website" />
Expand Down
10 changes: 5 additions & 5 deletions pages/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const Contact = () => {
<meta name="keywords" content="Contact, GitHub Community SRM, support, queries, FAQ, community help, reach out, open source support, SRMIST GitHub, GitHub Community support" />
<link
rel="canonical"
href="https://githubsrmist.tech/contact"
href="https://githubsrmist.in/contact"
/>
<meta property="og:title" content="Contact Us | GitHub Community SRM | Support & Queries" />
<meta property="og:description" content="Need help or have a query? Contact the GitHub Community SRM team for assistance. Explore our FAQ section for quick answers." />
<meta property="og:url" content="https://githubsrmist.tech/contact" />
<meta property="og:url" content="https://githubsrmist.in/contact" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="GitHub Community SRM" />
<meta property="og:image" content="/public/contact_us_image.png" />
Expand All @@ -36,19 +36,19 @@ const Contact = () => {
<meta name="twitter:description" content="Need help or have a query? Contact the GitHub Community SRM team for support and assistance. Check out our FAQ section for quick answers." />
<meta name="twitter:image" content="/public/Logo.png" />
<meta name="twitter:site" content="@GithubSrm" />
<meta name="twitter:url" content="https://githubsrmist.tech/contact" />
<meta name="twitter:url" content="https://githubsrmist.in/contact" />
<script type="application/ld+json">
{JSON.stringify({
"@context": "https://schema.org",
"@type": "ContactPage",
"url": "https://githubsrmist.tech/contact",
"url": "https://githubsrmist.in/contact",
"description": "Contact GitHub Community SRM for support, queries, or assistance. We are here to help with open source and community-related questions.",
"contactOption": [
{
"@type": "ContactPoint",
"telephone": "+91-9474182596",
"contactType": "Customer Support",
"email": "support@githubsrmist.tech"
"email": "support@githubsrmist.in"
}
]
})}
Expand Down
11 changes: 6 additions & 5 deletions pages/events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import RegisterDialogue from "@/components/Events/Register_dialogue/Registerdial
import Hero from "@/components/Events/LiveEvents/Hero";
import heroimg_events from "@/public/heroimg_events.png";
import Head from "next/head";
import { API_ENDPOINTS } from "@/utils/config";

const Events = () => {
const [eventData, setEventData] = useState(null);
Expand Down Expand Up @@ -35,7 +36,7 @@ const Events = () => {
useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch("../api/v1/events");
const response = await fetch(API_ENDPOINTS.EVENTS.GET_ALL);
if (!response.ok) {
throw new Error("Failed to fetch data");
}
Expand Down Expand Up @@ -91,7 +92,7 @@ const Events = () => {
/>
<meta
property="og:image"
content="https://githubsrmist.tech/logo.png"
content="https://githubsrmist.in/logo.png"
/>
<meta
property="og:image:alt"
Expand All @@ -108,18 +109,18 @@ const Events = () => {
/>
<meta
name="twitter:image"
content="https://githubsrmist.tech/logo.png"
content="https://githubsrmist.in/logo.png"
/>

<script type="application/ld+json">
{JSON.stringify({
"@context": "https://schema.org",
"@type": "Event",
name: "Hackathons, Workshops & Speaker Sessions | Github Community SRM Events",
url: "https://githubsrmist.tech/events",
url: "https://githubsrmist.in/events",
description:
"Discover and register for hackathons, workshops, and speaker sessions hosted by Github Community SRM.",
image: "https://githubsrmist.tech/logo.png",
image: "https://githubsrmist.in/logo.png",
location: {
"@type": "Place",
name: "SRM Institute of Science and Technology",
Expand Down
45 changes: 30 additions & 15 deletions pages/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ProfileCard from "@/components/Team/profileCard";
import { CSSTransition, TransitionGroup } from "react-transition-group";
import Head from "next/head";
import { set } from "mongoose";
import { API_ENDPOINTS } from '@/utils/config';

const ProfileSkeleton = () => {
return (
Expand All @@ -30,35 +31,42 @@ const Teams = () => {
useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch("../api/v1/team");
const response = await fetch(API_ENDPOINTS.TEAM.GET_ALL);
if (!response.ok) {
throw new Error("Failed to fetch data");
}
const data = await response.json();

const convenorData = data.data.find(
// Handle both response formats: direct array or {data: array}
const teamData = Array.isArray(data) ? data : (data.data || []);

const convenorData = teamData.find(
(item) => item.position === "Convenor"
);
const presidentData = data.data.find(
const presidentData = teamData.find(
(item) => item.position === "President"
);
const vpData = data.data.find(
const vpData = teamData.find(
(item) => item.position === "vicePresident"
);

// const adminsData = data.data.filter(
console.log("Convenor:", convenorData);
console.log("President:", presidentData);
console.log("VP:", vpData);

// const adminsData = teamData.filter(
// (item) => item.position === "Admin"
// );
const directorsData = data.data.filter(
const directorsData = teamData.filter(
(item) => item.position === "Director"
);
const leadsData = data.data.filter(
const leadsData = teamData.filter(
(item) => item.position === "Lead"
);
const associatesData = data.data.filter(
const associatesData = teamData.filter(
(item) => item.position === "Associate"
);
const membersData = data.data.filter(
const membersData = teamData.filter(
(item) => item.position === "Member"
);

Expand All @@ -72,7 +80,8 @@ const Teams = () => {
setMembers(membersData);
setFetched(true);
} catch (error) {
console.error(error);
console.error("Error fetching team data:", error);
setFetched(true); // Set to true even on error to stop loading state
}
};

Expand Down Expand Up @@ -139,7 +148,7 @@ const Teams = () => {
<meta property="og:title" content="Meet the Team | GitHub Community SRM | Technical, Corporate, Creative" />
<meta property="og:description" content="Meet the team behind GitHub Community SRM, including the President, Vice President, Leads, Associates, and Members from the Technical, Corporate, and Creative domains." />
<meta property="og:image" content="/public/Logo.png" />
<meta property="og:url" content="https://githubsrmist.tech/team" />
<meta property="og:url" content="https://githubsrmist.in/team" />
<meta property="og:type" content="website" />

<meta name="twitter:card" content="/public/Logo.png" />
Expand All @@ -153,7 +162,7 @@ const Teams = () => {
"@context": "https://schema.org",
"@type": "Organization",
"name": "GitHub Community SRM",
"url": "https://githubsrmist.tech",
"url": "https://githubsrmist.in",
"logo": "/public/Logo.png",
"sameAs": [
"https://github.com/SRM-IST-KTR",
Expand Down Expand Up @@ -205,7 +214,7 @@ const Teams = () => {
<div className="flex justify-center mt-8">
<ProfileSkeleton />
</div>
) : (
) : convenor ? (
<div className="flex justify-center mt-8">
<ProfileCard
photo={convenor.pictureUrl}
Expand All @@ -214,6 +223,8 @@ const Teams = () => {
socials={convenor.socials}
/>
</div>
) : (
<p className="text-center mt-8 text-gray-400">No convenor data available</p>
)}

<div className="flex flex-col md:flex-row justify-center items-center gap-8 lg:gap-16 p-8 mt-16">
Expand All @@ -223,13 +234,15 @@ const Teams = () => {
</h2>
{!fetched ? (
<ProfileSkeleton />
) : (
) : president ? (
<ProfileCard
photo={president.pictureUrl}
name={president.name}
caption={president.caption}
socials={president.socials}
/>
) : (
<p className="text-center text-gray-400">No president data available</p>
)}
</div>

Expand All @@ -239,13 +252,15 @@ const Teams = () => {
</h2>
{!fetched ? (
<ProfileSkeleton />
) : (
) : vp ? (
<ProfileCard
photo={vp.pictureUrl}
name={vp.name}
caption={vp.caption}
socials={vp.socials}
/>
) : (
<p className="text-center text-gray-400">No vice president data available</p>
)}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions public/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ User-agent: *
Allow: /

# Host
Host: https://githubsrmist.tech
Host: https://githubsrmist.in

# Sitemaps
Sitemap: https://githubsrmist.tech/sitemap.xml
Sitemap: https://githubsrmist.in/sitemap.xml
Loading
Loading