diff --git a/src/App.js b/src/App.js index b6dd0f9..2f5db4f 100644 --- a/src/App.js +++ b/src/App.js @@ -25,7 +25,7 @@ import { ThemeProvider } from "./context/ThemeContext"; import { Toaster } from "react-hot-toast"; import ProtectedRoute from "./components/ProtectedRoute"; import NotFoundPage from "./components/Error404"; - +import FAQ from "./components/FAQ"; // Importing the FAQ component import ScrollButton from "./components/ScrollButton"; // Import the ScrollButton function BackgroundWrapper({ children }) { @@ -53,7 +53,7 @@ export default function App() { } /> - } /> + } /> } /> } /> { + useEffect(() => { + const faqItems = document.querySelectorAll('.faq-item h3'); + faqItems.forEach(item => { + item.addEventListener('click', () => { + const answer = item.nextElementSibling; + const isActive = answer.classList.contains('active'); + + // Hide all answers + document.querySelectorAll('.faq-answer').forEach(ans => { + ans.classList.remove('active'); + }); + + // Toggle current answer + if (!isActive) { + answer.classList.add('active'); + } + }); + }); + }, []); + + return ( +
+

Frequently Asked Questions

+
+

What is a QR code, and how does it work?

+

A QR code is a type of matrix barcode that can be scanned using a smartphone camera to access information.

+
+
+

How can I customize a QR code on this website?

+

You can customize QR codes by selecting colors, shapes, and adding logos using our tools.

+
+
+

Are the QR codes generated here free to use?

+

Yes, all QR codes generated on this website are free to use.

+
+
+

Can I track the performance of my QR code?

+

Currently, we do not provide tracking features for QR codes.

+
+
+

Do the QR codes expire?

+

No, the QR codes generated do not expire.

+
+
+ ); +}; + +export default FAQ;