Skip to content

Commit aff4da0

Browse files
committed
feat: add FAQ page with Accordion component
1 parent 5c9814b commit aff4da0

3 files changed

Lines changed: 77 additions & 0 deletions

File tree

app/_components/Accordion.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use client';
2+
3+
import { useState } from 'react';
4+
import { IoChevronDown } from 'react-icons/io5';
5+
6+
interface AccordionProps {
7+
question: string;
8+
children: React.ReactNode;
9+
}
10+
11+
export default function Accordion({ question, children }: AccordionProps) {
12+
const [isOpen, setIsOpen] = useState(false);
13+
14+
return (
15+
<div className="border-b border-white/10 transition-all duration-200">
16+
<button
17+
onClick={() => setIsOpen(!isOpen)}
18+
className="w-full flex justify-between items-center py-5 text-left font-medium text-white hover:text-gray-300 transition-colors focus:outline-none"
19+
>
20+
<span className="text-xl font-bold">{question}</span>
21+
<IoChevronDown
22+
className={`w-6 h-6 text-gray-400 transition-transform duration-200 flex-shrink-0 ml-4 ${isOpen ? 'rotate-180' : ''
23+
}`}
24+
/>
25+
</button>
26+
<div
27+
className={`transition-all duration-200 ease-in-out overflow-hidden ${isOpen ? 'max-h-96 opacity-100' : 'max-h-0 opacity-0'
28+
}`}
29+
>
30+
<div className="pb-5 text-gray-300 leading-relaxed">
31+
{children}
32+
</div>
33+
</div>
34+
</div>
35+
);
36+
}

app/_components/Navbar.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default function Navbar() {
1717
<Link href="/about" className="text-xs font-semibold transition-colors hover:text-[#347BB2]">
1818
About
1919
</Link>
20+
<Link href="/faq" className="text-xs font-semibold transition-colors hover:text-[#347BB2]">
21+
FAQ
22+
</Link>
2023
</div>
2124
</div>
2225

app/faq/page.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import Accordion from '../_components/Accordion';
2+
3+
export default function FAQ() {
4+
return (
5+
<main className="flex flex-1 flex-col items-center px-4 py-20 md:justify-center md:py-0">
6+
<div className="mb-16 max-w-3xl w-full">
7+
<h1 className="text-4xl font-bold md:text-5xl">FAQ</h1>
8+
<p className="mt-4 text-gray-400">Frequently Asked Questions</p>
9+
<div className="mt-8 space-y-4">
10+
<Accordion question="What is Cobalt?">
11+
Cobalt is a mod for Minecraft 1.21.10 which speeds up the slow progression of Hypixel Skyblock; it is currently in development and is not yet available for download.
12+
</Accordion>
13+
<Accordion question="What is a Cobalt Addon?">
14+
An addon is a plugin for Cobalt which extends Cobalt's functionality by adding new features and commands.
15+
</Accordion>
16+
<Accordion question="Does Cobalt have a discord?">
17+
Yes, Cobalt has a discord server which can be found at <a href="https://discord.com/invite/GAhS8UfDyy" className="text-blue-400 hover:underline">discord.gg/GAhS8UfDyy</a>.
18+
</Accordion>
19+
<Accordion question="Is Cobalt safe to use?">
20+
The base mod and approved addons are safe from malware. However, Cobalt violates Hypixel's rules therefore we try our best to prevent bans, we cannot ensure that Cobalt will not cause you to get banned.
21+
</Accordion>
22+
<Accordion question="How do I install Cobalt?">
23+
As of right now, Cobalt is not available for download, once it is released, you can find the installation instructions here: First, install <a href="https://fabricmc.net/use/" className="text-blue-400 hover:underline">Fabric Loader</a> for Minecraft 1.21.10. Then, download the Cobalt mod file and place it in your <code className="bg-white/10 px-1.5 py-0.5 rounded text-sm">mods</code> folder located in your <code className="bg-white/10 px-1.5 py-0.5 rounded text-sm">.minecraft</code> directory. Launch Minecraft with the Fabric profile and you're ready to go.
24+
</Accordion>
25+
<Accordion question="Is Cobalt free?">
26+
Yes, Cobalt is free to use.
27+
</Accordion>
28+
<Accordion question="Can I contribute to Cobalt?">
29+
Not currently, after the mod is open source we will be open for contributions.
30+
</Accordion>
31+
<Accordion question="Will I get banned for using Cobalt?">
32+
While we work hard to prevent bans, we cannot ensure that Cobalt will not cause you to get banned.
33+
</Accordion>
34+
</div>
35+
</div>
36+
</main>
37+
)
38+
}

0 commit comments

Comments
 (0)