-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'ORIGIN/main' into fix/fix-custom-button
- Loading branch information
Showing
4 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: ( | ||
<div className="flex items-center justify-start"> | ||
<p className="pr-2">Click here to register:</p> | ||
<RegistrationButton /> | ||
<RegistrationButton /> {/* This is a custom button component will update later */} | ||
</div> | ||
), | ||
}, | ||
|
@@ -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<number | null>(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 ( | ||
<div className="h-auto mb-8 flex flex-col items-center text-white bg-base-100 " id="faq"> | ||
<div className="h-auto mb-8 flex flex-col items-center text-white bg-base-100" id="faq"> | ||
<div className="flex w-full desktop:w-2/3"> | ||
<h1 className=" font-mokoto font-normal text-white text-left text-4xl text-shadow-md pb-4">FAQs</h1> | ||
<h1 className="font-mokoto font-normal text-white text-left text-4xl text-shadow-md pb-4">FAQs</h1> | ||
<div> | ||
<div | ||
className={`${ | ||
highlightFAQ ? `fixed top-32 bg-white` : `absolute bg-hackrpi-secondary-dark-blue` | ||
} w-12 h-12 rounded-full border-[6px] border-hackrpi-primary-blue | ||
transition-colors duration-300 z-[5] right-1.5 2xs:right-3.5`} | ||
highlightFAQ ? "fixed top-32 bg-white" : "absolute bg-hackrpi-secondary-dark-blue" | ||
} w-12 h-12 rounded-full border-[6px] border-hackrpi-primary-blue transition-colors duration-300 z-[5] right-1.5 2xs:right-3.5`} | ||
></div> | ||
</div> | ||
</div> | ||
|
@@ -107,13 +114,18 @@ const FAQPage = () => { | |
index === faqs.length - 1 ? "border-b-2" : "" | ||
} border-hackrpi-primary-blue rounded-none`} | ||
> | ||
<input type="radio" name="my-accordion-1" defaultChecked={index === 0} /> | ||
<input | ||
type="checkbox" | ||
className="w-auto h-auto" | ||
checked={expandedIndex === index} | ||
onChange={() => handleToggle(index)} | ||
/> | ||
<div className="collapse-title font-medium text-2xl text-hackrpi-primary-blue">{faq.title}</div> | ||
<div className="collapse-content">{faq.content}</div> | ||
</div> | ||
))} | ||
</div> | ||
<div className="w-full desktop:w-2/3 "> | ||
<div className="w-full desktop:w-2/3"> | ||
<h2 id="sponsors" className="font-poppins text-2xl text-center pt-10"> | ||
Feel free to contact us with any other questions at{" "} | ||
<a href="mailto:[email protected]" className="text-hackrpi-primary-blue"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.