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

feat: add exit animation to mobile dialog drawer #1108

Merged
merged 16 commits into from
Nov 11, 2024

Conversation

iykazrji
Copy link
Collaborator

@iykazrji iykazrji commented Oct 26, 2024

Pull Request Checklist

Screenshots

Before:
https://www.loom.com/share/df896258fff140468e6b809e343efbb7?sid=7120c059-5567-49aa-a4fc-9ecf4052de68

After:
https://www.loom.com/share/81015edf28384c5aad5edd3137ea271b?sid=58f49f6a-b930-4a55-8f23-ddd97f08a3ae


PR-Codex overview

This PR enhances the animation capabilities of the Dialog component in the account-kit/react project by adding new animations and improving the rendering logic for the dialog's portal.

Detailed summary

  • Added fade-out and slide-down animations to the Tailwind CSS configuration.
  • Introduced useLayoutEffect to manage the rendering of the dialog portal based on its open state.
  • Utilized useRef for the dialog card reference.
  • Updated the dialog's class names to incorporate new animations and transitions.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Oct 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 11, 2024 7:58pm
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 11, 2024 7:58pm

Copy link
Collaborator

@moldy530 moldy530 left a comment

Choose a reason for hiding this comment

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

looks good, but can we avoid using the 3rd party library?

using the viewTransition api directly might be overkill. Can we instead either,

  1. remove the isOpen ? ... piece, always render the portal, and just selectively add the slide up or down animation based on the isOpen property
  2. useEffect triggered by changes on the on isOpen. This will in turn programmatically start the animation (up or down). If the animation is down, then on animation finished, remove the portal if we don't want it always rendered. Probs would need some internal show state as well here to handle this.

account-kit/react/package.json Outdated Show resolved Hide resolved
@iykazrji iykazrji merged commit afa37ea into main Nov 11, 2024
6 checks passed
@iykazrji iykazrji deleted the iyk/modal-exit-transitions branch November 11, 2024 20:00
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.

2 participants