diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/FAQ.module.scss b/apps/site/src/app/(main)/(home)/sections/FAQ/FAQ.module.scss deleted file mode 100644 index e095926e..00000000 --- a/apps/site/src/app/(main)/(home)/sections/FAQ/FAQ.module.scss +++ /dev/null @@ -1,19 +0,0 @@ -.container { - background: radial-gradient(50% 50% at 50% 50%, #2c1909 58.33%, #422810 100%), - #aa5315; -} - -.title { - text-shadow: 0px 0px 20px rgba(255, 255, 255, 0.75); -} - -@media (min-width: 640px) { - .container { - background-image: linear-gradient( - 180deg, - #432810 0.32%, - #2b1809 52.42%, - #442911 100% - ); - } -} diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/FAQ.tsx b/apps/site/src/app/(main)/(home)/sections/FAQ/FAQ.tsx index caade3eb..30cc3a02 100644 --- a/apps/site/src/app/(main)/(home)/sections/FAQ/FAQ.tsx +++ b/apps/site/src/app/(main)/(home)/sections/FAQ/FAQ.tsx @@ -1,8 +1,22 @@ +import Image from "next/image"; + import { getQuestions } from "./getQuestions"; -import FAQAccordion from "./FAQAccordion"; +import FAQAccordionMobile from "./FAQAccordionMobile"; +import FAQAccordionDesktop from "./FAQAccordionDesktop"; import { PortableText } from "@portabletext/react"; -import styles from "./FAQ.module.scss"; +import sprite from "./assets/sprite.png"; +import organizerTitle from "./assets/organizer-title.png"; + +export interface FAQAccordion { + faq: FAQ[]; +} + +export interface FAQ { + _key: string; + question: JSX.Element; + answer: JSX.Element; +} const FAQ = async () => { const questions = await getQuestions(); @@ -13,16 +27,39 @@ const FAQ = async () => { })); return ( -
-
-

- FAQ +
+
+

+ Frequently Asked Questions

- +
+
+
+ Wise anteater + +
+ + +
+
); diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/FAQAccordion.tsx b/apps/site/src/app/(main)/(home)/sections/FAQ/FAQAccordion.tsx deleted file mode 100644 index 814e1490..00000000 --- a/apps/site/src/app/(main)/(home)/sections/FAQ/FAQAccordion.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Root, Item, Trigger, Content } from "@/lib/components/Accordion"; - -interface FAQAccordion { - faq: { - _key: string; - question: JSX.Element; - answer: JSX.Element; - }[]; -} - -const FAQAccordion: React.FC = ({ faq }) => { - return ( - - {faq.map(({ _key, question, answer }) => ( - - {question} - {answer} - - ))} - - ); -}; - -export default FAQAccordion; diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/FAQAccordionDesktop.tsx b/apps/site/src/app/(main)/(home)/sections/FAQ/FAQAccordionDesktop.tsx new file mode 100644 index 00000000..a221b090 --- /dev/null +++ b/apps/site/src/app/(main)/(home)/sections/FAQ/FAQAccordionDesktop.tsx @@ -0,0 +1,138 @@ +"use client"; + +import React, { useState } from "react"; +import Image from "next/image"; + +import ListItemButton from "./components/ListItemButton"; +import TriangleIcon from "./components/TriangleIcon"; +import { FAQAccordion, FAQ } from "./FAQ"; + +import SpeechDesktop from "./assets/speech-desktop.svg"; + +const FAQAccordionDesktop: React.FC = ({ faq }) => { + const faqGroup1 = faq.slice(0, 8); + const faqGroup2 = faq.slice(8); + + const [page1Selected, setPage1Selected] = useState(true); + + const [focusedQuestion, setFocusedQuestion] = useState(null); + + return ( +
+ {/* Desktop View */} + Dialogue box background +
+ {/* Page 1 focused */} +
+ {faqGroup1.map((F) => ( + setFocusedQuestion(F)} + text={F.question} + inverted={false} + className="mb-0 py-[2px]" + /> + ))} +
+ +
+
+ + {/* Page 2 focused */} +
+ {faqGroup2.map((F) => ( + setFocusedQuestion(F)} + text={F.question} + inverted={false} + className="mb-0 py-[2px]" + /> + ))} +
+ +
+
+ + {/* Question is focused. */} +
+
+ setFocusedQuestion(null)} + className="mb-2 py-[2px]" + text={focusedQuestion?.question} + rotate="rotate-90" + inverted + /> + +

{focusedQuestion?.answer}

+
+ +
+ setFocusedQuestion(null)} + className="py-[2px] min-w-[175px] xl:min-w-[200px]" + text="Ask another question" + rotate="rotate-180" + inverted={false} + /> +
+
+
+
+ ); +}; + +export default FAQAccordionDesktop; diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/FAQAccordionMobile.tsx b/apps/site/src/app/(main)/(home)/sections/FAQ/FAQAccordionMobile.tsx new file mode 100644 index 00000000..ee149a98 --- /dev/null +++ b/apps/site/src/app/(main)/(home)/sections/FAQ/FAQAccordionMobile.tsx @@ -0,0 +1,83 @@ +"use client"; + +import React, { useState } from "react"; +import Image from "next/image"; + +import ListItemButton from "./components/ListItemButton"; +import { FAQAccordion, FAQ } from "./FAQ"; + +import SpeechMobile from "./assets/speech-mobile.svg"; + +const FAQAccordionMobile: React.FC = ({ faq }) => { + const [focusedQuestion, setFocusedQuestion] = useState(null); + + return ( +
+ {/* Changes size of parent component */} +
+
+ Dialogue box background + + {/* No question is focused. */} +
+
+ {faq.map((F) => ( + setFocusedQuestion(F)} + text={F.question} + className="md:p-2" + inverted={false} + /> + ))} +
+
+ + {/* Question is focused. */} +
+ setFocusedQuestion(null)} + className="mb-3" + text={focusedQuestion?.question} + rotate="rotate-90" + inverted + /> + +

{focusedQuestion?.answer}

+ +
+ setFocusedQuestion(null)} + text="Ask another question" + rotate="rotate-180" + inverted={false} + /> +
+
+
+
+ ); +}; + +export default FAQAccordionMobile; diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/assets/organizer-title.png b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/organizer-title.png new file mode 100644 index 00000000..8aba8be7 Binary files /dev/null and b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/organizer-title.png differ diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/assets/speech-desktop.svg b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/speech-desktop.svg new file mode 100644 index 00000000..4bab9bb8 --- /dev/null +++ b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/speech-desktop.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/assets/speech-mobile.svg b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/speech-mobile.svg new file mode 100644 index 00000000..423cea1c --- /dev/null +++ b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/speech-mobile.svg @@ -0,0 +1,10 @@ + + Source: openclipart.org/detail/209545 + + + + + + + + \ No newline at end of file diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/assets/sprite.png b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/sprite.png new file mode 100644 index 00000000..1926412a Binary files /dev/null and b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/sprite.png differ diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/assets/triangle-dark.svg b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/triangle-dark.svg new file mode 100644 index 00000000..9aed67df --- /dev/null +++ b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/triangle-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/assets/triangle.svg b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/triangle.svg new file mode 100644 index 00000000..96c26771 --- /dev/null +++ b/apps/site/src/app/(main)/(home)/sections/FAQ/assets/triangle.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/components/ListItemButton.tsx b/apps/site/src/app/(main)/(home)/sections/FAQ/components/ListItemButton.tsx new file mode 100644 index 00000000..9ce04a3c --- /dev/null +++ b/apps/site/src/app/(main)/(home)/sections/FAQ/components/ListItemButton.tsx @@ -0,0 +1,43 @@ +import TriangleIcon from "./TriangleIcon"; + +export default function ListItemButton({ + onClick, + text, + className, + rotate, + inverted, +}: { + onClick: () => void; + text: string | React.ReactNode; + className?: string; + rotate?: string; + inverted: boolean; +}) { + return ( + + ); +} diff --git a/apps/site/src/app/(main)/(home)/sections/FAQ/components/TriangleIcon.tsx b/apps/site/src/app/(main)/(home)/sections/FAQ/components/TriangleIcon.tsx new file mode 100644 index 00000000..b27d86fe --- /dev/null +++ b/apps/site/src/app/(main)/(home)/sections/FAQ/components/TriangleIcon.tsx @@ -0,0 +1,23 @@ +export default function TriangleIcon({ + className, + dark = false, +}: { + className?: string; + dark?: boolean; +}) { + return ( + + + + ); +}