-
Notifications
You must be signed in to change notification settings - Fork 49
added the FAQs section #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mdashad0
wants to merge
2
commits into
reactplay:main
Choose a base branch
from
mdashad0:add-FAQs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| export type FAQ = { | ||
| question: string; | ||
| answer: string; | ||
| }; | ||
|
|
||
| export const faqData: FAQ[] = [ | ||
| { | ||
| question: "What is React Kolkata?", | ||
| answer: | ||
| "React Kolkata is a community for React developers in Kolkata, organizing meetups, workshops, and events to help developers connect, learn, and grow together.", | ||
| }, | ||
| { | ||
| question: "Who can join React Kolkata?", | ||
| answer: | ||
| "Anyone interested in React, JavaScript, or web development can join React Kolkata. All skill levels are welcome!", | ||
| }, | ||
| { | ||
| question: "How can I participate in events?", | ||
| answer: | ||
| "You can participate by joining our community channels and keeping an eye on our events page for upcoming meetups and workshops.", | ||
| }, | ||
| { | ||
| question: "Is there any membership fee?", | ||
| answer: "No, joining React Kolkata and participating in our events is completely free.", | ||
| }, | ||
| { | ||
| question: "How can I contribute to the community?", | ||
| answer: | ||
| "You can contribute by volunteering, speaking at events, writing blog posts, or helping organize meetups. Reach out to us through our community channels!", | ||
| }, | ||
| { | ||
| question: "Where can I find event updates?", | ||
| answer: | ||
| "Event updates are posted on our website, social media, and community chat groups. Make sure to follow us and join our channels!", | ||
| }, | ||
| ]; |
mdashad0 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| "use client"; | ||
|
|
||
| import React, { useState } from "react"; | ||
|
|
||
| import { faqData } from "./faq-data"; | ||
|
|
||
| const FAQSection = () => { | ||
| const [openIndex, setOpenIndex] = useState<number | null>(null); | ||
|
|
||
| const toggleFAQ = (idx: number) => { | ||
| setOpenIndex(openIndex === idx ? null : idx); | ||
| }; | ||
|
|
||
| return ( | ||
| <section id="faq" className="bg-gradient-to-b from-slate-900 to-slate-800 py-20 text-white"> | ||
| <div className="mx-auto max-w-3xl px-4"> | ||
| <h2 className="mb-10 text-center text-4xl font-extrabold tracking-tight"> | ||
| <span className="bg-gradient-to-r from-sky-400 to-blue-600 bg-clip-text text-transparent"> | ||
| Frequently Asked Questions | ||
| </span> | ||
| </h2> | ||
| <div className="space-y-4"> | ||
| {faqData.map((faq, idx) => ( | ||
| <div | ||
| key={idx} | ||
| className={ | ||
| "rounded-lg border border-slate-700 bg-slate-800/70 shadow-lg transition-all" + | ||
| (openIndex === idx ? " ring-2 ring-sky-400/60" : "") | ||
| } | ||
| > | ||
| <button | ||
| className="group flex w-full items-center justify-between px-6 py-5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-sky-400" | ||
| onClick={() => toggleFAQ(idx)} | ||
| aria-expanded={openIndex === idx} | ||
| aria-controls={`faq-panel-${idx}`} | ||
| > | ||
| <span className="text-lg font-semibold transition-colors group-hover:text-sky-400"> | ||
| {faq.question} | ||
| </span> | ||
| <svg | ||
| className={ | ||
| "ml-4 h-6 w-6 text-sky-400 transition-transform duration-300" + | ||
| (openIndex === idx ? " rotate-180" : "") | ||
| } | ||
| fill="none" | ||
| viewBox="0 0 24 24" | ||
| stroke="currentColor" | ||
| strokeWidth={2} | ||
| > | ||
| <path strokeLinecap="round" strokeLinejoin="round" d="M19 9l-7 7-7-7" /> | ||
| </svg> | ||
| </button> | ||
| <div | ||
| id={`faq-panel-${idx}`} | ||
| className={ | ||
| "overflow-hidden px-6 transition-all duration-300" + | ||
| (openIndex === idx ? " max-h-40 py-2" : " max-h-0 py-0") | ||
| } | ||
| aria-hidden={openIndex !== idx} | ||
| > | ||
| <p className="text-base text-slate-300">{faq.answer}</p> | ||
| </div> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </section> | ||
| ); | ||
| }; | ||
|
|
||
| export default FAQSection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.