Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate: useDisclosure hook #13459

Closed
wants to merge 4 commits into from
Closed

migrate: useDisclosure hook #13459

wants to merge 4 commits into from

Conversation

wackerow
Copy link
Member

Description

  • Builds on custom internal useDisclosure hook introduced in Migrate FeedbackWidget to shadcn #13456
  • Deprecates all usage of Chakra-UI useDisclosure hook, updating imports to use new custom src/hooks/useDisclosure.ts

Related Issue

shadcn migration

@wackerow wackerow added the refactor ♻️ Changes which don't affect functionality label Jul 23, 2024
@github-actions github-actions bot added the tooling 🔧 Changes related to tooling of the project label Jul 23, 2024
Copy link

netlify bot commented Jul 23, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit d804a56
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/66a0312ff5c49d0008b54b8c
😎 Deploy Preview https://deploy-preview-13459--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: 46 (🔴 down 5 from production)
Accessibility: 92 (no change from production)
Best Practices: 89 (🔴 down 9 from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

Copy link
Member

Choose a reason for hiding this comment

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

I think this hook is too complex for what we need for the new components. I've created a simpler useDisclosure here that, I think will be a better fit to our use cases from now on. LMK what do you think, do we need more than a simple boolean flag? all the a11y attr will be handled by the radix components.

Copy link
Member Author

Choose a reason for hiding this comment

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

This approach was primarily to match previous functionality, so the other places we use useDisclosure could be swapped out without any additional refactoring (as in d804a56).

I'd be fine with minimizing to the example you shared since I don't believe we'll need the getButtonProps and getDisclosureProps helpers anymore with shadcn. In this case, I can close this PR/branch, and I can update #13456 to use your suggested useDisclosure from 263698d inside #13449. 👍

@wackerow wackerow closed this Jul 24, 2024
@github-actions github-actions bot added the abandoned This has been abandoned or will not be implemented label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned This has been abandoned or will not be implemented refactor ♻️ Changes which don't affect functionality tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants