From 4c82a5dc98fe0f638e906104745ea51a761fcca8 Mon Sep 17 00:00:00 2001 From: rohan Date: Sat, 26 Oct 2024 22:55:59 +0530 Subject: [PATCH] fix: resolve infinite loading at faq page --- frontend/src/components/FAQ-feature/FAQ.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/FAQ-feature/FAQ.jsx b/frontend/src/components/FAQ-feature/FAQ.jsx index 962fdf7f..d007e704 100644 --- a/frontend/src/components/FAQ-feature/FAQ.jsx +++ b/frontend/src/components/FAQ-feature/FAQ.jsx @@ -1,10 +1,11 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import '../../styles/FAQ.css'; // Import your CSS import '../../styles/preloaderStyle.css'; const FAQs = () => { const [activeIndex, setActiveIndex] = useState(null); const [searchQuery, setSearchQuery] = useState(''); // Add state for search query + const [isLoading, setIsLoading] = useState(true); const faqs = [ { question: "What warranty does Xiaomi offer on its products?", answer: "Xiaomi typically offers a one-year warranty on most of its devices. However, warranty terms may vary depending on the product and region, so it’s best to check the specific warranty policy for your item." }, @@ -32,10 +33,18 @@ const FAQs = () => { setActiveIndex(activeIndex === index ? null : index); }; + useEffect(()=>{ + setTimeout(()=>{ + setIsLoading(false); + }, 2000); + },[]); + return (
-
+
< div class="wrapper">