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 (
-
-