Skip to content

refactor animation prop into a ref method#8

Merged
elizabetdev merged 1 commit intoelizabetdev:notification_header_buttonfrom
chandlerprall:notification_header_button_method
Feb 1, 2021
Merged

refactor animation prop into a ref method#8
elizabetdev merged 1 commit intoelizabetdev:notification_header_buttonfrom
chandlerprall:notification_header_button_method

Conversation

@chandlerprall
Copy link

Summary

Refactored the animation prop into an animate method on the ref

ref,
() => {
if (buttonRef) {
(buttonRef as any).triggerAnimation = () => {
Copy link
Author

Choose a reason for hiding this comment

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

This part that breaks good practices, but seems to be a decent compromise.

() => {
if (buttonRef) {
(buttonRef as any).triggerAnimation = () => {
const keyframes: Keyframe[] = [
Copy link
Author

Choose a reason for hiding this comment

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

This is converted straight from the CSS animation. We can probably find a small math solution to generating these in a loop instead. Either way is fine.

'euiHeaderSectionItemButton__content--isAnimating': animation,
});
const animationClasses = classNames([
'euiHeaderSectionItemButton__content',
Copy link
Author

Choose a reason for hiding this comment

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

This PR did not update all snapshots affected by this change.

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