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
Add Collapse Animation To LatestReadme #3523
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of using third-party libraries for this as the animation feels off (especially considering we just standardized them). It does not conform with our animations and it is slow.
However, this is definitely better than nothing 🤩. But we should write up a todo for removing react-collapse
(it's only used one other place).
useEffect(() => { | ||
setExpanded(expandedInitially); | ||
}, [expandedInitially]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this useEffect
? In my mind it has no effect 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In prod, it will not have any effect, since all the fetching is done server side before it reaches the client. However, when running this locally, the value changes as the fetching is happening. And for some reason, the component does not re render when the initial value changes as the fetches happen. Therefore, the initial value ends up wrong, if you do not include this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Use the Collapse element from "react-select" to animate the LatestReadme component. This makes it much smoother to look at, as it does not jump from collapsed to expanded.
Result
Before
Screen.Recording.2023-02-06.at.15.24.41.mov
After
Screen.Recording.2023-02-06.at.15.22.42.mov
Testing
Resolves ABA-251