From 0ccf40cde73e809ba10f102c8fbf6c064ae6c90d Mon Sep 17 00:00:00 2001 From: Ikki Date: Wed, 6 Nov 2024 10:46:14 +0530 Subject: [PATCH 1/3] faq-added --- .../src/AgroShopAI/components/ShopFooter.jsx | 2 +- frontend/src/AgroShopAI/pages/Faq.jsx | 123 ++++++++++++++++++ frontend/src/MainContent.jsx | 2 + 3 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 frontend/src/AgroShopAI/pages/Faq.jsx diff --git a/frontend/src/AgroShopAI/components/ShopFooter.jsx b/frontend/src/AgroShopAI/components/ShopFooter.jsx index b670cfd5..143a0a73 100644 --- a/frontend/src/AgroShopAI/components/ShopFooter.jsx +++ b/frontend/src/AgroShopAI/components/ShopFooter.jsx @@ -132,7 +132,7 @@ const ShopFooter = () => {
  • - + FAQ
  • diff --git a/frontend/src/AgroShopAI/pages/Faq.jsx b/frontend/src/AgroShopAI/pages/Faq.jsx new file mode 100644 index 00000000..b33b3fa5 --- /dev/null +++ b/frontend/src/AgroShopAI/pages/Faq.jsx @@ -0,0 +1,123 @@ +import React, { useState } from "react"; +import { BiChevronUp } from 'react-icons/bi'; + +const FAQ = () => { + const [activeIndex, setActiveIndex] = useState(null); + const [faqCount, setFaqCount] = useState(5); // Show 5 FAQs initially + + const faqs = [ + { + "question": "What types of products does AgroShop offer?", + "answer": "AgroShop offers a wide range of products to meet all agricultural needs, including seeds, fertilizers, pesticides, soil health kits, farming tools, machinery, and crop disease prediction tools." + }, + { + "question": "How can I track my order?", + "answer": "Once your order is confirmed, we’ll send a tracking link to your email or SMS. You can also log in to your AgroShop account and go to 'My Orders' to view the current status of your order." + }, + { + "question": "Do you offer bulk discounts?", + "answer": "Yes, we offer bulk discounts on selected products. Contact our customer support team or check the product page for information on available bulk pricing options." + }, + { + "question": "How do I return a product?", + "answer": "If you’re not satisfied with your purchase, you can initiate a return within 7 days of receiving your order. Go to 'My Orders', select the item you wish to return, and follow the return instructions provided." + }, + { + "question": "Can I get expert advice on which products to buy?", + "answer": "Yes! AgroShop provides access to expert recommendations for farmers. Our team can help you select the right products for your specific crops, soil type, and climate." + }, + { + "question": "What payment options are available?", + "answer": "We accept multiple payment methods including credit/debit cards, net banking, UPI, and popular mobile wallets for a seamless checkout experience." + }, + { + "question": "Do you deliver to rural areas?", + "answer": "Yes, AgroShop is committed to serving farmers across urban and rural areas. We deliver nationwide, ensuring that farmers everywhere have access to quality agricultural products." + }, + { + "question": "Are the products on AgroShop certified?", + "answer": "Yes, we only offer products from certified suppliers to ensure quality and reliability. Each product listing includes certification details for your reference." + }, + { + "question": "Can I cancel my order?", + "answer": "You can cancel your order before it is shipped by going to 'My Orders' and selecting the cancel option. Once shipped, cancellation may not be available." + }, + { + "question": "How does AgroShop handle product quality issues?", + "answer": "If you encounter any quality issues with your purchase, please reach out to our support team. We will assist you with a return or exchange based on the situation." + }, + { + "question": "Does AgroShop offer any loyalty or reward program?", + "answer": "Yes, AgroShop has a loyalty program where you earn points on every purchase. These points can be redeemed for discounts on future orders." + }, + { + "question": "Can I set up a subscription for recurring products like fertilizers?", + "answer": "Yes, we offer a subscription service for products you need regularly, such as fertilizers and seeds. Choose the subscription option on the product page to set your delivery frequency." + }, + { + "question": "How can I contact customer support?", + "answer": "You can reach our customer support team via phone, email, or live chat on our website. Our team is available to assist you Monday to Saturday from 9 AM to 6 PM." + } + ] + + const handleToggle = (index) => { + setActiveIndex(activeIndex === index ? null : index); + }; + + const loadMoreFAQs = () => { + setFaqCount(prevCount => Math.min(prevCount + 3, faqs.length)); // Load 3 more FAQs but not exceed total FAQs + }; + + return ( +
    + +
    +
    +

    + Frequently Asked Questions +

    +
    + {faqs.slice(0, faqCount).map((faq, index) => ( +
    +
    + +
    +
    +
    + {faq.answer} +
    +
    +
    + ))} +
    + {faqCount < faqs.length && ( +
    + +
    + )} +
    +
    +
    + + ); +}; + +export default FAQ; diff --git a/frontend/src/MainContent.jsx b/frontend/src/MainContent.jsx index eae4e714..576ddaab 100644 --- a/frontend/src/MainContent.jsx +++ b/frontend/src/MainContent.jsx @@ -61,6 +61,7 @@ import CancelAndReturnPolicy from './AgroShopAI/pages/FooterPages/CancelAndRetur import TermsOfUse from './AgroShopAI/pages/FooterPages/TermsOfUse'; import ForgotPasswordPage from './components/ForgotPassword'; import AccountVerificationPage from './components/EmailVerification'; +import FAQ from './AgroShopAI/pages/Faq'; const MainContent = () => { UseScrollToTop(); @@ -150,6 +151,7 @@ const MainContent = () => { {/* Footer Links */} } /> } /> + } /> {checkShop ? :