diff --git a/com-dict-client/src/components/Faqs/index.js b/com-dict-client/src/components/Faqs/index.js new file mode 100644 index 0000000..eb405c0 --- /dev/null +++ b/com-dict-client/src/components/Faqs/index.js @@ -0,0 +1,84 @@ +import React, { useState } from "react"; +import { Row, Col} from "antd"; +const faqs = [ + { + question: "What is a Community Dictionary?", + answer: + "A Community Dictionary is a web application where users can submit and search for definitions of words or phrases.", + }, + { + question: + "How do I create an account on the Community Dictionary web application?", + answer: + "To create an account on the Community Dictionary, click on the 'Sign Up' button and fill out the registration form.", + }, + { + question: "How do I submit a new entry to the Community Dictionary?", + answer: + "To submit a new entry to the Community Dictionary, click on the 'Plus' icon and fill out the entry form.", + }, + { + question: + "How can I search for a specific entry on the Community Dictionary?", + answer: + "To search for a specific entry on the Community Dictionary, use the search bar on the homepage and enter the word or phrase you're looking for.", + }, + { + question: + "How can I report inaccurate or inappropriate entries on the Community Dictionary?", + answer: + "To report inaccurate or inappropriate entries on the Community Dictionary, click on the 'Report' button of that particular word and fill out the report form.", + }, + { + question: "Is the Community Dictionary available in multiple languages?", + answer: + "Yes, Communution Dictionary is multilingual Dictionary web application.", + }, + { + question: "Can I access the Community Dictionary on my mobile device?", + answer: + "Yes, the Community Dictionary is accessible on most mobile devices via a web browser.", + }, +]; + +const FaqsSection = () => { + const [activeIndex, setActiveIndex] = useState(-1); + + const handleClick = (index) => { + if (activeIndex === index) { + setActiveIndex(-1); + } else { + setActiveIndex(index); + } + }; + + return ( +
+

Frequently Asked Questions (FAQ)

+ {faqs.map((faq, index) => ( +
handleClick(index)}> + + +

Q.

+ + +

{faq.question}

+ +
+ + +

A.

+ + +

{faq.answer}

+ +
+
+ ))} +
+ ); +}; + +export default FaqsSection; diff --git a/com-dict-client/src/components/Footer/FooterPage.js b/com-dict-client/src/components/Footer/FooterPage.js index 1a4af6a..4dc0ff4 100644 --- a/com-dict-client/src/components/Footer/FooterPage.js +++ b/com-dict-client/src/components/Footer/FooterPage.js @@ -70,7 +70,7 @@ function Footer() { - + FAQ diff --git a/com-dict-client/src/containers/Faqs/faqs.css b/com-dict-client/src/containers/Faqs/faqs.css new file mode 100644 index 0000000..906dd70 --- /dev/null +++ b/com-dict-client/src/containers/Faqs/faqs.css @@ -0,0 +1,38 @@ +.faq-section { + max-width: 1200px; + margin: 0 auto; + padding: 20px; + font-family: Arial, sans-serif; +} +.faq-section h1 { + font-size: 3rem; + font-weight: bold; +} + +.faq { + margin-bottom: 10px; + cursor: pointer; +} + +.faq h3 { + font-size: 1.5rem; + margin-bottom: 10px; +} + +.faq p { + font-size: 1.3rem; +} + +.hide-answer { + display: none; +} + +.show-answer { + display: block; + margin-bottom: 10px; + font-size: 16px; +} + +.question { + background-color: #f0f2f5; +} \ No newline at end of file diff --git a/com-dict-client/src/containers/Faqs/faqs.js b/com-dict-client/src/containers/Faqs/faqs.js new file mode 100644 index 0000000..09065fa --- /dev/null +++ b/com-dict-client/src/containers/Faqs/faqs.js @@ -0,0 +1,25 @@ +import React from "react"; +import { Layout } from "antd"; +import TitleBar from "../../components/Header"; +import FaqsSection from "../../components/Faqs"; +import FooterPage from "../../components/Footer/FooterPage"; +import "./faqs.css" +const { Header, Footer, Content } = Layout; + +function Faqs() { + return ( + +
+ +
+ + + +
+ +
+
+ ); +} + +export default Faqs; diff --git a/com-dict-client/src/containers/Faqs/faqs.test.js b/com-dict-client/src/containers/Faqs/faqs.test.js new file mode 100644 index 0000000..e69de29 diff --git a/com-dict-client/src/routes.js b/com-dict-client/src/routes.js index 10a0924..ada7669 100644 --- a/com-dict-client/src/routes.js +++ b/com-dict-client/src/routes.js @@ -10,6 +10,7 @@ import Categories from "./containers/categories/categories"; import CommentWord from "./containers/comment/comment"; import Report from "./containers/reportWord/reportWord"; import Search from "./containers/search/search"; +import Faqs from "./containers/Faqs/faqs"; import { useSelector } from "react-redux"; // import { auth } from "./config"; @@ -27,6 +28,7 @@ export default function Routes() { + ); }