Skip to content

Commit

Permalink
faqs page
Browse files Browse the repository at this point in the history
  • Loading branch information
inkerton committed Nov 5, 2024
1 parent 1e3d738 commit 57a0c68
Show file tree
Hide file tree
Showing 5 changed files with 369 additions and 0 deletions.
239 changes: 239 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 @@ -27,6 +27,8 @@
"@clerk/nextjs": "^5.7.1",
"@clerk/themes": "^2.1.40",
"@prisma/client": "^5.20.0",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-icons": "^1.3.1",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-slot": "^1.1.0",
"axios": "^1.7.7",
Expand Down
63 changes: 63 additions & 0 deletions src/app/faqs/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion"

const faqs = [
{
question: "Is my data secure on DearDiary?",
answer: "Absolutely! Your entries are encrypted and accessible only to you. We prioritize your privacy, so you can journal freely knowing your data is protected."
},
{
question: "Can I interact with other users on DearDiary?",
answer: "Yes! DearDiary has a community support feature where you can connect with others, share insights, and find encouragement from like-minded individuals."
},
{
question: "What tools are available to help with self-care?",
answer: "DearDiary offers guided meditation, gratitude prompts, and other self-care resources to support your mental wellness alongside journaling."
},
{
question: "How does the AI-powered insights feature work?",
answer: "Our AI analysis tools help you explore themes and patterns in your entries, offering insights into your thoughts and emotions to support your self-discovery journey."
},
{
question: "Can I track my mood over time?",
answer: "Yes! The mood tracking feature allows you to visualize your emotional journey over time, making it easier to understand how your moods evolve."
},
{
question: "How can I make sure I journal consistently?",
answer: "With customizable reminders, DearDiary can prompt you to journal regularly at times that work best for you, helping you build a steady journaling habit."
},
{
question: "Is it possible to set goals and track my journaling progress?",
answer: "Definitely! DearDiary’s progress tracking feature lets you set personal goals and monitor your growth and achievements over time."
},
];

export default function FAQs() {
return (
<div>
<header className="text-center mb-10 mt-10">
<h1 className="text-6xl font-bold mb-4">
Frequently Asked Questions
</h1>
<p className="text-2xl text-gray-300 max-w-2xl mx-auto">
Got any doubts! We are here to answer everything!
</p>
</header>

<div className="items-center mx-auto py-8 max-w-2xl">
<Accordion type="single" collapsible>
{faqs.map((faq, index) => (
<AccordionItem key={index} value={`item-${index + 1}`}>
<AccordionTrigger className="text-xl">{faq.question}</AccordionTrigger>
<AccordionContent className="text-lg">{faq.answer}</AccordionContent>
</AccordionItem>
))}
</Accordion>
</div>
</div>
);
}
43 changes: 43 additions & 0 deletions src/components/ui/accordion.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"use client"

import * as React from "react"
import * as AccordionPrimitive from "@radix-ui/react-accordion"
import { ChevronDownIcon } from "@radix-ui/react-icons"

import { cn } from "@/lib/utils"

const Accordion = AccordionPrimitive.Root

const AccordionItem = React.forwardRef(({ className, ...props }, ref) => (
<AccordionPrimitive.Item ref={ref} className={cn("border-b", className)} {...props} />
))
AccordionItem.displayName = "AccordionItem"

const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => (
<AccordionPrimitive.Header className="flex">
<AccordionPrimitive.Trigger
ref={ref}
className={cn(
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",
className
)}
{...props}>
{children}
<ChevronDownIcon
className="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" />
</AccordionPrimitive.Trigger>
</AccordionPrimitive.Header>
))
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName

const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => (
<AccordionPrimitive.Content
ref={ref}
className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
{...props}>
<div className={cn("pb-4 pt-0", className)}>{children}</div>
</AccordionPrimitive.Content>
))
AccordionContent.displayName = AccordionPrimitive.Content.displayName

export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
Loading

0 comments on commit 57a0c68

Please sign in to comment.