feat: Add FAQs page#110
Conversation
|
Help Wanted per il fade della versione mobile |
WalkthroughThis PR refactors the FAQ page into a component-based tabbed architecture with responsive, scrollable navigation. The page now exports Next.js metadata, delegates FAQ rendering to a new ChangesFAQ Page Redesign with Tabs & Scrollable Layout
Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…yNews, and Deprecated pages
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/components/faqs/faqs-tabs.tsx (1)
112-112: ⚡ Quick winAvoid hard-coding the default tab key.
Using
"tab5"directly makes the initial state brittle: if values are renamed/removed, no panel is selected by default.♻️ Proposed fix
- <Tabs defaultValue="tab5" className="flex w-full flex-col items-center"> + <Tabs defaultValue={faqItems[0]?.value} className="flex w-full flex-col items-center">🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/faqs/faqs-tabs.tsx` at line 112, The Tabs component in faqs-tabs.tsx currently hardcodes defaultValue="tab5", which can break when tab keys change; update Tabs to derive its default value from the actual tabs data (e.g., use the first entry of the tabs array or a TAB_KEYS constant) or make the active tab controlled via state in the FaQsTabs component so the initial selected tab is computed (refer to the Tabs component, defaultValue prop, and the tabs data/array used to render TabList/TabPanel) and replace the literal "tab5" with that derived value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/faqs/faqs-tabs.tsx`:
- Around line 38-40: Several FAQ entries in src/components/faqs/faqs-tabs.tsx
repeat the same "Per le lauree le lezioni sono sospese?" trigger/content across
unrelated tab groups (occurring at the diff ranges you noted); consolidate by
extracting that repeated Q/A into a single shared constant (e.g., LEZIONI_FAQ)
or helper (e.g., getLezioniFaq()) and replace the duplicated inline objects with
references to that constant in the tab arrays (or remove duplicates and keep a
single canonical entry per relevant category), ensuring only one source of truth
for the trigger/content to avoid inconsistent copies.
In `@src/styles/globals.css`:
- Around line 38-39: The two mask declarations are inconsistent: mask-image uses
calc(100% - 36px) while -webkit-mask-image uses calc(100% - 28px); update the
-webkit-mask-image declaration so its gradient stops match mask-image (i.e.,
transparent, black 28px, black calc(100% - 36px), transparent) so both
mask-image and -webkit-mask-image use the same start (28px) and end (36px) fade
distances.
---
Nitpick comments:
In `@src/components/faqs/faqs-tabs.tsx`:
- Line 112: The Tabs component in faqs-tabs.tsx currently hardcodes
defaultValue="tab5", which can break when tab keys change; update Tabs to derive
its default value from the actual tabs data (e.g., use the first entry of the
tabs array or a TAB_KEYS constant) or make the active tab controlled via state
in the FaQsTabs component so the initial selected tab is computed (refer to the
Tabs component, defaultValue prop, and the tabs data/array used to render
TabList/TabPanel) and replace the literal "tab5" with that derived value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e7b8a4d3-7341-42be-8566-a49d8c2bdd72
📒 Files selected for processing (7)
src/app/faqs/page.tsxsrc/components/accordion-association/index.tsxsrc/components/callout-item/types.tssrc/components/faqs/faqs-tabs.tsxsrc/components/tabs/tabs-list.tsxsrc/components/ui/item.tsxsrc/styles/globals.css
💤 Files with no reviewable changes (1)
- src/components/accordion-association/index.tsx
Add FAQs page
Closes #91