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

[ECO-2169] Fix animations by updating the component keys for the emoji grid items #238

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

xbtmatt
Copy link
Collaborator

@xbtmatt xbtmatt commented Sep 6, 2024

Description

The animations got screwed up a bit back when I was fixing the lack of a grid line when search emojis are used.

I added the index to each grid item component key, meaning it re-animates any time its position in the grid changes, but that's not what we want, because for bump order in particular, the animations are set up to be triggered by changes to the orderedGrid variable, not the component key. (They're set up this way by framer-motion, which animates the grid order, indicated by the presence of the layout prop in an animated component)

In order to fix this bug while still respecting the original fix, I've added the searchEmojis to the component keys and removed the index from the component key.

Thus the searchEmojis changing will trigger a re-render, which subsequently forces the component to re-checks if the grid line on its left should be present. However, if the grid re-orders due to the bumpOrder changing, the component will animate properly because its key will remain the same, since the index is no longer in the key.

Testing

Tested it on the production branch to visually ensure things are working as expected now, but the fixes can go in right now to main and will work as expected down the road when everything is set up

Checklist

  • Did you update relevant documentation?
  • Did you add tests to cover new code or a fixed issue?
  • Did you update the changelog?
  • Did you check all checkboxes from the linked Linear task?

@xbtmatt xbtmatt requested review from alnoki and CRBl69 September 6, 2024 01:22
Copy link

vercel bot commented Sep 6, 2024

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

Name Status Preview Comments Updated (UTC)
emojicoin-dot-fun ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 5:30pm
emojicoin-dot-fun-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 5:30pm

Copy link
Collaborator

@CRBl69 CRBl69 left a comment

Choose a reason for hiding this comment

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

👍

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.

3 participants