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 ( - <> -
-
- Pink Swiggly Background -
- -
- Sponsor Image -
- -
-

{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 ( + <> + -
-
- Sundae Image -
- UADS Logo -

University of Auckland

-

Dessert Society

-
-

Where dessert lovers go to celebrate the art of eating and making desserts

-
- -
- Cupcake Image -
-
+
+
+ Sundae Image +
+ UADS Logo +

University of Auckland

+

Dessert Society

+
+

+ Where dessert lovers go to celebrate the art of eating and making desserts +

+
+ +
+ Cupcake Image +
+
-
-

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

+
+
-