forked from amnannn/rekan_ai
add produk
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
import { useState } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
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);
|
||||
@@ -111,7 +122,7 @@ const FAQ = () => {
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="text-[#212121] max-w-4xl mx-auto px-4 py-6 text-center ">
|
||||
<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">
|
||||
|
||||
Reference in New Issue
Block a user