This commit is contained in:
Carls2320
2025-02-17 13:38:41 +07:00
16 changed files with 238 additions and 198 deletions

View File

@@ -1,9 +1,19 @@
import { useState, useEffect } from "react";
import { useLocation } from "react-router-dom";
import { useInView } from "react-intersection-observer";
const FAQ = () => {
const location = useLocation();
useEffect(() => {
if (location.hash) {
const element = document.querySelector(location.hash);
if (element) {
element.scrollIntoView({ behavior: "smooth" });
}
}
}, [location]);
// State untuk menyimpan indeks pertanyaan yang sedang dibuka
// Jika tidak ada pertanyaan yang terbuka, nilai adalah null
const [openQuestion, setOpenQuestion] = useState(null);
useEffect(() => {
@@ -31,7 +41,8 @@ const FAQ = () => {
];
return (
<div className="text-[#212121] max-w-4xl mx-auto px-4 py-6 text-center" id="faq">
<div className="text-[#212121] max-w-4xl mx-auto px-4 py-6 text-center " id="faq">
{/* Judul halaman FAQ */}
<div className="mt-[111px]">
<h1 className="text-[32px] font-[505] leading-[48px] tracking-[0.005em] text-center mb-4">
Frequently Asked Questions