Skip to content

Commit

Permalink
Merge pull request #2 from VanJS/Add-FAQ-section
Browse files Browse the repository at this point in the history
Add-FAQ-section
  • Loading branch information
bibschan authored Aug 18, 2024
2 parents a9ffa93 + 8fcd7cc commit da8e755
Show file tree
Hide file tree
Showing 5 changed files with 382 additions and 7 deletions.
179 changes: 179 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"lint": "next lint"
},
"dependencies": {
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-slot": "^1.1.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand Down
23 changes: 16 additions & 7 deletions src/app/page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Link from "next/link";
import { Button } from "@/components/ui/button";
import { AccordionFAQ } from "@/components/ui/accordion/index";
import {
Card,
CardHeader,
Expand Down Expand Up @@ -63,6 +64,13 @@ export default function Home() {
>
Speakers
</Link>
<Link
href="#faq"
className="hover:underline underline-offset-4"
prefetch={false}
>
FAQ
</Link>
<Link
href="#footer-contact"
className="hover:underline underline-offset-4"
Expand Down Expand Up @@ -440,13 +448,14 @@ export default function Home() {
</div>
</div>
</section>
<section
id="contact"
className="w-full py-12 md:py-24 lg:py-32 bg-muted"
>
<div className="container space-y-12 px-4 md:px-6">
<div className="flex flex-col items-center justify-center space-y-4 text-center">
<div className="space-y-2" />
<section id="faq" className="w-full md:py-24 lg:py-30 bg-muted">
<div className="container space-y-12 px-2 md:px-4">
<div className="flex flex-col items-center space-y-4 text-center">
<h2 className="text-3xl font-bold sm:text-5xl my-2">FAQs</h2>
<p className="max-w-[900px] my-2 text-muted-foreground md:text-xl/relaxed lg:text-base/relaxed xl:text-xl/relaxed">
Some frequent questions from our community:
</p>
<AccordionFAQ />
</div>
</div>
</section>
Expand Down
90 changes: 90 additions & 0 deletions src/components/ui/accordion/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import * as React from "react";
import * as Accordion from "@radix-ui/react-accordion";
import { cn } from "@/lib/utils";
import { ChevronDownIcon } from "@radix-ui/react-icons";
import "./styles.css";

export const AccordionFAQ = () => (
<div className="block w-3/4">
<Accordion.Root
className={`AccordionRoot ${cn("w-full")}`}
type="single"
defaultValue="item-1"
collapsible
>
<Accordion.Item className="AccordionItem" value="faq-1">
<AccordionTrigger>Who can attend the meetup?</AccordionTrigger>
<AccordionContent className="bg-white text-left">
Our meetup welcomes everyone interested in the Vancouver JavaScript
community! Whether you are a complete beginner, an experienced
developer, or simply curious about JavaScript, we invite you to join
us. We welcome humans from all backgrounds, genders, ages and
experiences—come be part of our community!
</AccordionContent>
</Accordion.Item>

<Accordion.Item className="AccordionItem" value="faq-2">
<AccordionTrigger>
When and where does the meetup take place?
</AccordionTrigger>
<AccordionContent className="bg-white text-left">
We usually meet once a month, and occasionally have smaller related
events running 1-2 times a month. The location varies, largely
depending on our ability to secure a venue. We typically announce the
details a month in advance.
</AccordionContent>
</Accordion.Item>

<Accordion.Item className="AccordionItem" value="faq-3">
<AccordionTrigger>
You have sponsors but charge for the ticket?
</AccordionTrigger>
<AccordionContent className="bg-white text-left">
Our entrance fee is mostly symbolic, as we ran VanJS free of charge
for the longest time and found that 40% of the RSVPs were no-shows,
leaving us with tons of food and drinks that went to waste. The meetup
organizers don&apos;t take profit from the event, everything is
reinvested into the meetup (prizes, better venues, parties, etc).
<br />
<br />
If you want to attend the meetup but have no means to contribute at
this time, reach out to one of our organizers on LinkedIn and they
will be happy to assist on a case-by-case basis.
</AccordionContent>
</Accordion.Item>
</Accordion.Root>
</div>
);

const AccordionTrigger = React.forwardRef(
({ children, className, ...props }, forwardedRef) => (
<Accordion.Header
className={`AccordionHeader ${cn("text-2xl font-semibold leading-none")}`}
>
<Accordion.Trigger
className={cn("AccordionTrigger", className)}
{...props}
ref={forwardedRef}
>
{children}
<ChevronDownIcon className="AccordionChevron" aria-hidden />
</Accordion.Trigger>
</Accordion.Header>
)
);

AccordionTrigger.displayName = Accordion.Trigger.displayName;

const AccordionContent = React.forwardRef(
({ children, className, ...props }, forwardedRef) => (
<Accordion.Content
className={cn("AccordionContent", className)}
{...props}
ref={forwardedRef}
>
<div className="AccordionContentText">{children}</div>
</Accordion.Content>
)
);

AccordionContent.displayName = Accordion.Content.displayName;
Loading

0 comments on commit da8e755

Please sign in to comment.