diff --git a/web/src/components/SponsorCard.tsx b/web/src/components/SponsorCard.tsx
deleted file mode 100644
index 5181e52..0000000
--- a/web/src/components/SponsorCard.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { SponsorCardProps } from "../utils/FrontendTypes";
-import background from "../assets/pink_sponsor_background.png";
-
-export default function SponsorCard({ sponsor }: SponsorCardProps) {
- const { name, description, image } = sponsor;
-
- return (
- <>
-
-
-
-
-
-
-
-
-
-
-
{name}
-
{description}
-
-
- >
- );
-}
diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx
index f155167..2d5a961 100644
--- a/web/src/pages/Home.tsx
+++ b/web/src/pages/Home.tsx
@@ -11,170 +11,201 @@ import "swiper/css";
import "swiper/css/pagination";
import "swiper/css/navigation";
import { Autoplay, Pagination } from "swiper/modules";
-import SponsorCard from "../components/SponsorCard";
import axios from "axios";
import { useEffect, useState } from "react";
-import { EventType, SponsorType } from "../utils/FrontendTypes";
+import { EventType } from "../utils/FrontendTypes";
export default function Home() {
- const [events, setEvents] = useState([]);
- const [sponsors, setSponsors] = useState([]);
+ const [events, setEvents] = useState([]);
+ // const [sponsors, setSponsors] = useState([]);
- useEffect(() => {
- async function fetchEvents() {
- try {
- const response = await axios.get("http://localhost:4000/api/events/");
- setEvents(response.data);
- } catch (error) {
- console.error("Error fetching event data", error);
- }
- }
- async function fetchSponsors() {
- try {
- const response = await axios.get("http://localhost:4000/api/sponsors/");
- setSponsors(response.data);
- } catch (error) {
- console.error("Error fetching sponsor data", error);
- }
- }
+ useEffect(() => {
+ async function fetchEvents() {
+ try {
+ const response = await axios.get("http://localhost:4000/api/events/");
+ setEvents(response.data);
+ } catch (error) {
+ console.error("Error fetching event data", error);
+ }
+ }
+ // async function fetchSponsors() {
+ // try {
+ // const response = await axios.get("http://localhost:4000/api/sponsors/");
+ // setSponsors(response.data);
+ // } catch (error) {
+ // console.error("Error fetching sponsor data", error);
+ // }
+ // }
- fetchSponsors();
- fetchEvents();
- }, []);
+ // fetchSponsors();
+ fetchEvents();
+ }, []);
- return (
- <>
-
+ return (
+ <>
+
-
-
-
-
-
-
University of Auckland
-
Dessert Society
-
-
Where dessert lovers go to celebrate the art of eating and making desserts
-
-
-
-
-
-
+
+
+
+
+
+
University of Auckland
+
Dessert Society
+
+
+ Where dessert lovers go to celebrate the art of eating and making desserts
+
+
+
+
+
+
+
-
-
Supported by our Sponsors
+
+
+ Supported by our Sponsors
+
-
-
- {sponsors.map((sponsor, index) => {
- return (
-
-
-
- );
- })}
-
-
+
+
+ {events.map((event, index) => {
+ return (
+
+
+
+ );
+ })}
+
+
-
- See More Sponsors
-
-
+
+
+ See More Sponsors
+
+
+
-
-
Our Exciting Events
+
+
+ Our Exciting Events
+
-
-
- {events.map((event, index) => {
- return (
-
-
-
- );
- })}
-
-
+
+
+ {events.map((event, index) => {
+ return (
+
+
+
+ );
+ })}
+
+
-
- See More Events
-
-
+
+
+ See More Events
+
+
+
-
-
Join UADS Today!
+
+
Join UADS Today!
-
- Join
-
-
+
+ Join
+
+
-
- >
- );
+
+ >
+ );
}
diff --git a/web/src/pages/Sponsor.tsx b/web/src/pages/Sponsor.tsx
index 75287d2..af49826 100644
--- a/web/src/pages/Sponsor.tsx
+++ b/web/src/pages/Sponsor.tsx
@@ -1,86 +1,7 @@
-import donut from "../assets/half_donut_jelly.svg";
-import Navbar from "../components/Navbar";
-import Footer from "../components/Footer";
-import { useState, useEffect } from "react";
-import SponsorCard from "../components/SponsorCard";
-import axios from "axios";
-import { SponsorType } from "../utils/FrontendTypes";
-
export default function Sponsor() {
- const [searchQuery, setSearchQuery] = useState("");
- const [sponsors, setSponsors] = useState([]);
- const [displayedSponsors, setDisplayedSponsors] = useState([]);
-
- useEffect(() => {
- async function fetchSponsors() {
- try {
- const response = await axios.get("http://localhost:4000/api/sponsors/");
- setSponsors(response.data);
- setDisplayedSponsors(response.data);
- } catch (error) {
- console.error("Error fetching sponsor data", error);
- }
- }
- fetchSponsors();
- }, []);
-
- const handleSearchChange = (e: React.ChangeEvent) => {
- const query = e.target.value.toLowerCase();
- setSearchQuery(query);
-
- // Filter sponsorData based on the search query
- const filteredSponsors = sponsors.filter((sponsor) =>
- sponsor.name.toLowerCase().includes(query)
- );
- setDisplayedSponsors(filteredSponsors);
- };
-
return (
<>
-
-
-
-
-
-
- Our Sponsors
-
-
-
-
-
-
-
-
-
-
-
-
-
- {displayedSponsors.length > 0 ? (
- displayedSponsors.map((sponsor, index) => (
-
-
-
- ))
- ) : (
-
- Sorry, no sponsor found for "{searchQuery}"
-
- )}
-
-
-
-
+ Sponsors Page
>
);
}
\ No newline at end of file
diff --git a/web/src/pages/__tests__/Sponsor.test.tsx b/web/src/pages/__tests__/Sponsor.test.tsx
deleted file mode 100644
index cc19ec7..0000000
--- a/web/src/pages/__tests__/Sponsor.test.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { render, screen } from "@testing-library/react";
-import Sponsor from "../Sponsor";
-import { MemoryRouter } from "react-router-dom";
-import "@testing-library/jest-dom";
-
-/*
- * Test suite to test if the elements in the Sponsor Page are rendered correctly
- */
-describe("Sponsor Page Rendering", () => {
- it("Should display the Sponsor page title", () => {
- // Render the Sponsor component in a simulated DOM
- render(
-
-
-
- );
-
- const message = screen.getByText(/Our Sponsors/i);
-
- expect(message).toBeInTheDocument();
- });
-});