diff --git a/package-lock.json b/package-lock.json index e92efdf..115cde6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,8 @@ "firebase": "^10.13.0", "next": "14.2.6", "react": "^18", - "react-dom": "^18" + "react-dom": "^18", + "react-icons": "^5.3.0" }, "devDependencies": { "@types/node": "^20", @@ -2355,6 +2356,14 @@ "react": "^18.3.1" } }, + "node_modules/react-icons": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.3.0.tgz", + "integrity": "sha512-DnUk8aFbTyQPSkCfF8dbX6kQjXA9DktMeJqfjrg6cK9vwQVMxmcA3BfP4QoiztVmEHtwlTgLFsPuH2NskKT6eg==", + "peerDependencies": { + "react": "*" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", diff --git a/package.json b/package.json index 14a7f82..60d1f2d 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "firebase": "^10.13.0", "next": "14.2.6", "react": "^18", - "react-dom": "^18" + "react-dom": "^18", + "react-icons": "^5.3.0" }, "devDependencies": { "@types/node": "^20", diff --git a/src/app/faq/page.tsx b/src/app/faq/page.tsx new file mode 100644 index 0000000..1c4dd47 --- /dev/null +++ b/src/app/faq/page.tsx @@ -0,0 +1,67 @@ +"use client"; + +import FaqAccordion, { mockData } from "../../components/faq/FAQAccordian"; +import Image from "next/image"; + +export default function Page() { + return ( + <> +
+
+
+

+
FAQs
+

+

+ Opening Ceremony +

+
+ Fintech Summit Logo +
+ +

+ Hackathon +

+ +

+ Workshops +

+ +

+ Demo day +

+ +
+ + ); +} diff --git a/src/components/faq/FAQAccordian.tsx b/src/components/faq/FAQAccordian.tsx new file mode 100644 index 0000000..c4461f8 --- /dev/null +++ b/src/components/faq/FAQAccordian.tsx @@ -0,0 +1,75 @@ +"use client"; +import { useState } from "react"; +import { FaPlus, FaMinus, FaMinusCircle, FaPlusCircle } from "react-icons/fa"; +import { FAQItemProps } from "./FAQItem"; + +export const FaqAccordion = ({ items }: { items: FAQItemProps[] }) => { + const [activeIndex, setActiveIndex] = useState(null); + + const handleClick = (index: number) => { + setActiveIndex(index === activeIndex ? null : index); + }; + + return ( +
+ {items.map((item, index) => ( +
+
handleClick(index)} + > +
+ + {String(index + 1).padStart(2, "0")} + +

+ {item.question} +

+
+ + {activeIndex === index ? ( + + ) : ( + + )} + +
+ {activeIndex === index && ( +
{item.answer}
+ )} +
+ ))} +
+ ); +}; + +export const mockData: Record< + "openingCeremony" | "hackathon" | "workshops" | "demo", + FAQItemProps[] +> = { + openingCeremony: [ + { question: "When is the Opening Ceremony?", answer: "Insert answer here" }, + { + question: "Where is the Opening Ceremony?", + answer: "Insert answer here", + }, + ], + hackathon: [ + { question: "When is the Hackathon?", answer: "Insert answer here" }, + { question: "Where is the Hackathon?", answer: "Insert answer here" }, + ], + workshops: [ + { question: "When is the Workshop?", answer: "Insert answer here" }, + { question: "Where is the Workshop?", answer: "Insert answer here" }, + ], + demo: [ + { question: "When is the Demo?", answer: "Insert answer here" }, + { question: "Where is the Demo?", answer: "Insert answer here" }, + ], +}; + +export default FaqAccordion; diff --git a/src/components/faq/FAQItem.tsx b/src/components/faq/FAQItem.tsx index 6872c90..c50eea4 100644 --- a/src/components/faq/FAQItem.tsx +++ b/src/components/faq/FAQItem.tsx @@ -1,6 +1,6 @@ -import React from 'react'; +import React from "react"; -interface FAQItemProps { +export interface FAQItemProps { question: string; answer: string; } @@ -14,4 +14,4 @@ const FAQItem: React.FC = ({ question, answer }) => { ); }; -export default FAQItem; \ No newline at end of file +export default FAQItem;