add produk

This commit is contained in:
Yogamnan
2025-02-14 16:40:23 +07:00
parent 8cb7eeadc1
commit 3148ff7a2e
24 changed files with 201 additions and 125 deletions

View File

@@ -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">