-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add faq components and section on signup page
- Loading branch information
Showing
8 changed files
with
122 additions
and
33 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,31 @@ | ||
import clsx from "clsx"; | ||
import Image from "next/image"; | ||
import { useState, useCallback } from "react"; | ||
|
||
import type { FAQItemProps } from "../types"; | ||
|
||
export const FAQItem = ({ title, description }: FAQItemProps): JSX.Element => { | ||
const [isOpen, setIsOpen] = useState<boolean>(false); | ||
|
||
const openDescription = useCallback(() => { | ||
setIsOpen(!isOpen); | ||
}, [isOpen, setIsOpen]); | ||
|
||
return ( | ||
<div className="flex w-3/5 flex-col gap-4 border-b border-b-black py-6"> | ||
<button className="flex cursor-pointer justify-between" type="button" onClick={openDescription}> | ||
<p className="font-mono text-2xl uppercase">{title}</p> | ||
|
||
<Image | ||
alt="arrow-down" | ||
className={clsx(isOpen && "origin-center rotate-180")} | ||
height="24" | ||
src="/arrow-down.svg" | ||
width="24" | ||
/> | ||
</button> | ||
|
||
{isOpen && <div className="text-black">{description}</div>} | ||
</div> | ||
); | ||
}; |
This file contains 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 @@ | ||
import { FAQItem } from "./FaqItem"; | ||
|
||
export const FAQList = (): JSX.Element => ( | ||
<div className="mt-28 flex flex-col items-center justify-center"> | ||
<h1 className="mb-8">FAQ</h1> | ||
|
||
<FAQItem | ||
description="(Please enter the main focus and description of this round.)" | ||
title="what is the focus of this round?" | ||
/> | ||
|
||
<FAQItem | ||
description="(This is related to what gatekeeper is used.)" | ||
title="Who are the requirements for participation?" | ||
/> | ||
|
||
<FAQItem | ||
description={ | ||
<div className="flex flex-col gap-4"> | ||
<p>Minimal Anti-Collusion Infrastructure (MACI) is a private, on-chain, voting system.</p> | ||
|
||
<p> | ||
MACI is an open-source cryptographic protocol designed to facilitate secure, anonymous voting systems while | ||
minimizing the potential for collusion, manipulation and bribery using zero-knowledge proofs. | ||
</p> | ||
</div> | ||
} | ||
title="What is MACI?" | ||
/> | ||
|
||
<FAQItem | ||
description="Join our Telegram group or Discord channel to learn more!" | ||
title="Do you have any other questions?" | ||
/> | ||
</div> | ||
); |
This file contains 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,6 @@ | ||
import type { ReactNode } from "react"; | ||
|
||
export interface FAQItemProps { | ||
title: string; | ||
description: ReactNode; | ||
} |
This file contains 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 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 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