forked from yashrasniya/URJAA-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFaq.jsx
68 lines (61 loc) · 1.85 KB
/
Faq.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { useState } from "react";
import classes from "./Faq.module.css";
const questions = [
{
question: "What is URJAA?",
answer:
"URJAA 2k24 is the one of biggest Technical event in the history of DYPCOE.",
},
{
question: "What are the Dates and Timings of event?",
answer:
"The event will start at 9AM on 29 March and will be till 31st of March 10 PM",
},
{
question: "How can I participate in the event?",
answer:
"Explore various events on the URJAA's website and register for the same",
},
{
question: "Is there any entry fee for URJAA 2k24?",
answer:
"No, there is not any entry fee to explore URJAA 2k24 but to participate in some events you have pay registration fee.",
},
];
const Faq = () => {
const [clicked, setClicked] = useState(null);
const toggle = (i) => {
if (clicked === i) {
return setClicked(null);
}
setClicked(i);
};
return (
<section className={classes.faqSection}>
<div className={classes.heading}>FAQ</div>
<div className={classes.faq}>
{questions.map((ques, i) => {
return (
<div className={classes.single} onClick={() => toggle(i)}>
<div className={classes.question}>{ques.question}</div>
<div
className={`${
clicked === i ? classes.answer : classes.noAnswer
}`}
>
{ques.answer}
</div>
<span className={classes.btn}>+</span>
</div>
);
})}
{/* <div className={classes.single}>
<div className={classes.question}>How are you?</div>
<div className={classes.answer}>I am fine</div>
<span className={classes.btn}>+</span>
</div> */}
</div>
</section>
);
};
export default Faq;