From 4b536ed5d1a3d41266ef7dbbef32e4cc5709b73f Mon Sep 17 00:00:00 2001 From: Richard <114359598+yipqp@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:32:46 -0700 Subject: [PATCH] Build events page --- client/src/components/EventCard.jsx | 84 +++++++++++++++++++++++ client/src/components/EventModal.jsx | 99 ++++++++++++++++++++++++++++ client/src/components/Navbar.jsx | 14 ++-- client/src/pages/Events.jsx | 9 --- client/src/pages/EventsPage.jsx | 66 +++++++++++++++++++ 5 files changed, 256 insertions(+), 16 deletions(-) create mode 100644 client/src/components/EventCard.jsx create mode 100644 client/src/components/EventModal.jsx delete mode 100644 client/src/pages/Events.jsx create mode 100644 client/src/pages/EventsPage.jsx diff --git a/client/src/components/EventCard.jsx b/client/src/components/EventCard.jsx new file mode 100644 index 0000000..7884fa6 --- /dev/null +++ b/client/src/components/EventCard.jsx @@ -0,0 +1,84 @@ +import React from "react"; + +const EventCard = ({ + title, + date, + place = "", + description, + setShowEventModal, + setEventModalContent, +}) => { + const showModal = (e) => { + setShowEventModal(true); + setEventModalContent({ + title: title, + date: date, + place: place, + description: description, + }); + }; + return ( +
+

{title}

+
+
+ + + + + + +

+ {date} +

+
+
+ + + +

{place}

+
+
+
+ ); +}; + +export default EventCard; diff --git a/client/src/components/EventModal.jsx b/client/src/components/EventModal.jsx new file mode 100644 index 0000000..9016586 --- /dev/null +++ b/client/src/components/EventModal.jsx @@ -0,0 +1,99 @@ +import React from "react"; + +const EventModal = ({ + eventModalContent, + showEventModal, + setShowEventModal, +}) => { + return showEventModal ? ( +
+
+ +
+
+

{eventModalContent.title}

+
+
+ + + + + + +

+ {eventModalContent.date} +

+
+
+ + + +

+ {eventModalContent.place} +

+
+

{eventModalContent.description}

+
+
+
+ ) : null; +}; + +export default EventModal; diff --git a/client/src/components/Navbar.jsx b/client/src/components/Navbar.jsx index f59285f..cf8f6e2 100644 --- a/client/src/components/Navbar.jsx +++ b/client/src/components/Navbar.jsx @@ -1,11 +1,11 @@ -import React from 'react' +import React from "react"; import logo from "../../images/logo.svg"; -import { Link } from 'react-scroll' -import { motion } from 'framer-motion' +import { Link } from "react-scroll"; +import { motion } from "framer-motion"; const Navbar = () => { return ( -