Skip to content

Create FAQ Accordion Component#13840

Merged
wackerow merged 7 commits into
ethereum:devfrom
saurabhburade:faq-component
Jul 22, 2025
Merged

Create FAQ Accordion Component#13840
wackerow merged 7 commits into
ethereum:devfrom
saurabhburade:faq-component

Conversation

@saurabhburade
Copy link
Copy Markdown
Contributor

@saurabhburade saurabhburade commented Sep 10, 2024

Description

Create FaqAccordion Component

Related Issue

@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 10, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit e5100df
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/687ed5f9480c530008f566e8
😎 Deploy Preview https://deploy-preview-13840--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 53 (🟢 up 4 from production)
Accessibility: 94 (no change from production)
Best Practices: 92 (no change from production)
SEO: 99 (no change from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@saurabhburade
Copy link
Copy Markdown
Contributor Author

Currently, using a tailwind accordion code copy with few modifications.

@saurabhburade saurabhburade marked this pull request as ready for review September 10, 2024 10:21
@saurabhburade saurabhburade marked this pull request as draft September 25, 2024 05:52
@saurabhburade saurabhburade marked this pull request as ready for review October 3, 2024 05:37
Copy link
Copy Markdown
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the help here @saurabhburade! Just left some questions, requests, etc =)

Comment thread src/components/FaqAccordian/index.tsx Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accordiOn not accordiAn

Need to fix the file paths here: FaqAccordion/index.tsx
(Same with the story: FaqAccordion/FaqAccordion.stories.tsx)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, this also makes me wonder if we should even be calling this "FaqAccordion", since in the DS it's just called FAQ... @pettinarip Any thoughts here? Simply calling this component/FAQ/index.tsx would work for me, and could just swap "FAQ" for "Accordion" in the exported sub-components in this file.

Comment thread src/components/FaqAccordian/index.tsx Outdated
Comment thread src/components/FaqAccordian/index.tsx Outdated
Comment thread src/components/FaqAccordian/index.tsx Outdated
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
>(({ className, children, ...props }, ref) => (
// p-4 hover:bg-background-highlight
<AccordionPrimitive.Header className="flex w-full">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we didn't go with the existing AccordionTrigger from tailwind/ui/accordion.tsx, instead of rebuilding from the Radix-UI primitive?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used for grouping styles with MdChevronRight ==> "group-hover:border-primary group-hover:text-primary group-hover:shadow-md group-hover:shadow-primary-low-contrast"

Comment thread src/components/FaqAccordian/index.tsx Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen.Recording.2024-10-22.at.11.14.51.mov

Functioning pretty well, just noting we should handle the width. In the DS we have max-width: 52rem; Ultimately though, the width shouldn't change when open vs closed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can implement max-width: 52rem; or near valuemax-w-4xl ==> 56rem. One thing I notice is, its taking parent width if mentioned and fits it to full width (trigger & content both)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen.Recording.2024-10-23.at.12.38.55.AM.mov

@github-actions
Copy link
Copy Markdown
Contributor

This issue is stale because it has been open 30 days with no activity.

@github-actions github-actions Bot added the Status: Stale This issue is stale because it has been open 30 days with no activity. label Nov 23, 2024
wackerow added 2 commits July 16, 2025 13:50
  Component Changes:
  - Renamed from FaqAccordion to Faq
  - Updated to use ui/accordion components instead of direct @radix-ui/react-accordion imports
  - Removed react-icons dependency - the ChevronNext icon is now handled by the ui/accordion components
  - Fixed import path from tailwind/ui/accordion to ui/accordion
  - Simplified component structure while maintaining custom styling

  Story Changes:
  - Renamed file from FaqAccordion.stories.tsx to Faq.stories.tsx
  - Updated all component references to use new names (Faq, FaqContent, FaqItem, FaqTrigger)
  - Changed story name from FaqAccordionStory to Faq following standard conventions. categorized in Molecules / Display Content / Faq
@wackerow wackerow removed the Status: Stale This issue is stale because it has been open 30 days with no activity. label Jul 16, 2025
Copy link
Copy Markdown
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey folks, circling back.

Pushed a couple commits to merge with latest dev and update code conventions since this was last touched.

image

cc: @pettinarip for another set of eyes

Copy link
Copy Markdown
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen.Recording.2025-07-21.at.17.09.18.mov

Polished this up a bit more; should match DS fully. Bringing in, thanks again for getting this going @saurabhburade!

@wackerow wackerow merged commit 2a16bd1 into ethereum:dev Jul 22, 2025
6 of 7 checks passed
@gitpoap-bot
Copy link
Copy Markdown

gitpoap-bot Bot commented Jul 22, 2025

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2025 Ethereum.org Contributor:

GitPOAP: 2025 Ethereum.org Contributor GitPOAP Badge

Join the [ethereum.org Discord server](https://ethereum.org/discord) to explore more ways to contribute to the project. Depending on the tasks you complete, you may also unlock additional rewards. Visit [ethereum.org/contributing](https://ethereum.org/contributing) to learn more.

Head to gitpoap.io & connect your GitHub account to mint!Keep buidling, keep learning, and let's grow the Ethereum open-source community together 🌱

Learn more about GitPOAPs here.

This was referenced Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create FAQ component

2 participants