From 0119f8f47c780ce674dde76c9405afee091eadbb Mon Sep 17 00:00:00 2001 From: "use-tusk[bot]" <144006087+use-tusk[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 00:35:57 +0000 Subject: [PATCH] improvement(faqs): center header and allow multiple expanded items --- bifrost/components/templates/landing/faqs.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/bifrost/components/templates/landing/faqs.tsx b/bifrost/components/templates/landing/faqs.tsx index ca90159a6e..ea66cb19a0 100644 --- a/bifrost/components/templates/landing/faqs.tsx +++ b/bifrost/components/templates/landing/faqs.tsx @@ -3,32 +3,38 @@ import { ChevronRightIcon } from "@heroicons/react/24/outline"; import { useState } from "react"; export default function Faqs() { - const [open, setOpen] = useState(-1); + const [openItems, setOpenItems] = useState([]); return (
-

- Frequently Asked
Questions +

+ Frequently Asked Questions

{FAQS.map((faq, index) => (
setOpen((prev) => (prev === index ? -1 : index))} + onClick={() => { + setOpenItems((prev) => + prev.includes(index) + ? prev.filter((item) => item !== index) + : [...prev, index] + ); + }} key={index} className="w-full p-4 border-2 border-sky-100 rounded-xl cursor-pointer" >

{faq.question}

{faq.answer}