diff --git a/components/faq/faq.tsx b/components/faq/faq.tsx index 2980231..2ca75d0 100644 --- a/components/faq/faq.tsx +++ b/components/faq/faq.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react"; -import "../../app/globals.css"; // Global styles location for tailwind css +import "../../app/globals.css"; import RegistrationButton from "../nav-bar/registration-button"; type FAQ = { @@ -33,7 +33,7 @@ const faqs: FAQ[] = [ content: (

Click here to register:

- + {/* This is a custom button component will update later */}
), }, @@ -50,7 +50,7 @@ const faqs: FAQ[] = [ { title: "Who else will be there?", content: - "Not only can you meet other RPI students and people from other colleges, but we’ve got wonderful sponsors who make this event possible! You’ll have the opportunity to talk to representatives from a variety of tech companies at career-fair style tables.", + "Not only can you meet other RPI students and people from other colleges, but we've got wonderful sponsors who make this event possible! You'll have the opportunity to talk to representatives from a variety of tech companies at career-fair style tables.", }, { title: "Does HackRPI provide travel reimbursement?", @@ -61,6 +61,7 @@ const faqs: FAQ[] = [ const FAQPage = () => { const [highlightFAQ, setHighlightFAQ] = useState(false); + const [expandedIndex, setExpandedIndex] = useState(null); useEffect(() => { // Highlight the FAQ section in the navbar when the user scrolls to it @@ -79,23 +80,29 @@ const FAQPage = () => { faqStart = (document.getElementById("faq")?.offsetTop || window.innerHeight) - 140; faqEnd = faqStart + (document.getElementById("faq")?.offsetHeight || window.innerHeight); }; + window.addEventListener("resize", handleResize); window.addEventListener("scroll", handleScroll); + return () => { + window.removeEventListener("resize", handleResize); window.removeEventListener("scroll", handleScroll); }; }, []); + const handleToggle = (index: number) => { + setExpandedIndex((prevIndex) => (prevIndex === index ? null : index)); + }; + return ( -
+
-

FAQs

+

FAQs

@@ -107,13 +114,18 @@ const FAQPage = () => { index === faqs.length - 1 ? "border-b-2" : "" } border-hackrpi-primary-blue rounded-none`} > - + handleToggle(index)} + />
{faq.title}
{faq.content}
))}
-
+

Feel free to contact us with any other questions at{" "} diff --git a/components/mlh-banner/mlh-banner.tsx b/components/mlh-banner/mlh-banner.tsx index 1509e04..5e1b8f0 100644 --- a/components/mlh-banner/mlh-banner.tsx +++ b/components/mlh-banner/mlh-banner.tsx @@ -6,7 +6,7 @@ export default function MlhBanner() { id="mlh-trust-badge" href="https://mlh.io/na?utm_source=na-hackathon&utm_medium=TrustBadge&utm_campaign=2024-season&utm_content=white" target="_blank" - className="block max-w-[80] desktop:max-w-[100px] min-w-[60px] w-[10%] h-auto fixed right-[25px] desktop:right-[50px] top-0 z-[10000] " + className="block max-w-[80] desktop:max-w-[100px] min-w-[60px] w-[10%] h-auto fixed right-[25px] desktop:right-[75px] top-0 z-[10000] " > + ); @@ -38,6 +40,7 @@ export default function NavBar({ showOnScroll }: { showOnScroll: boolean }) { <>
+
); diff --git a/package-lock.json b/package-lock.json index 534be62..a4e8c33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5318,4 +5318,4 @@ } } } -} \ No newline at end of file +}