From e42c3c7a5176d138c6ddb9681580529f35cfdb81 Mon Sep 17 00:00:00 2001 From: "diana.dolgolyova" Date: Tue, 10 Mar 2026 20:05:56 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20FAQ=20section=20redesign=20=E2=80=94=20?= =?UTF-8?q?compact=20cards,=20expand/collapse,=20bigger=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 6 ++ src/components/sections/FAQ.tsx | 124 ++++++++++++++++++++------------ 2 files changed, 84 insertions(+), 46 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 901321d..28af5ae 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -72,6 +72,12 @@ src/ - 2 addresses in Minsk, Yandex Maps embed with markers - Contact: phone, Instagram +## AST Index +- **Always use the AST index** at `memory/ast-index.md` when searching for components, props, hooks, types, or styles +- Contains: component tree, all exports, props, hooks, client/server status, CSS classes, keyframes +- Covers all 31 TS/TSX files + 4 CSS files +- Update the index when adding/removing/renaming files or exports + ## Git - Remote: Gitea at `git.dolgolyov-family.by` - User: diana.dolgolyova diff --git a/src/components/sections/FAQ.tsx b/src/components/sections/FAQ.tsx index 673bbbd..d74413b 100644 --- a/src/components/sections/FAQ.tsx +++ b/src/components/sections/FAQ.tsx @@ -1,19 +1,25 @@ "use client"; import { useState } from "react"; -import { Plus, Minus } from "lucide-react"; +import { ChevronDown } from "lucide-react"; import { siteContent } from "@/data/content"; import { SectionHeading } from "@/components/ui/SectionHeading"; import { Reveal } from "@/components/ui/Reveal"; +const VISIBLE_COUNT = 4; + export function FAQ() { const { faq } = siteContent; const [openIndex, setOpenIndex] = useState(null); + const [expanded, setExpanded] = useState(false); function toggle(index: number) { setOpenIndex(openIndex === index ? null : index); } + const visibleItems = expanded ? faq.items : faq.items.slice(0, VISIBLE_COUNT); + const hasMore = faq.items.length > VISIBLE_COUNT; + return (
@@ -22,55 +28,81 @@ export function FAQ() { {faq.title} -
- {[0, 1].map((col) => { - const half = Math.ceil(faq.items.length / 2); - const items = col === 0 ? faq.items.slice(0, half) : faq.items.slice(half); - const offset = col === 0 ? 0 : half; +
+ {visibleItems.map((item, idx) => { + const isOpen = openIndex === idx; return ( -
- {items.map((item, i) => { - const idx = offset + i; - return ( - -
- -
-
-
- {item.answer} -
-
-
+ +
+ + +
+
+
+ {item.answer}
- - ); - })} -
+
+
+
+
); })} + + {/* Show more / less */} + {hasMore && ( + +
+ +
+
+ )}