-
Notifications
You must be signed in to change notification settings - Fork 1k
Added button busy animation #6656
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
Conversation
<Button | ||
primary | ||
busy={{ | ||
state: busy, |
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.
Would it make more sense for busy
to be a boolean. Then the "success" state would automatically rendered for "X" amount of time when busy changes from true to false?
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.
Pausing now to think about what happens if a button is busy, then the process fails..
so maybe scratch that.
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.
Based on our discussion yesterday evening I changed busy
to be a boolean. I changed messages
to no longer be nested within busy and instead just a prop on Button. I also added a success
prop that is a boolean.
100% { transform: scale(1); } | ||
`; | ||
|
||
export const GrowCheckmark = styled(FormCheckmark)` |
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.
We've been talking about leaning away from use of "Form" icons --> wondering if we should use the normal "Checkmark" here. @ericsoderberghp
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.
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 think we should ensure it looks reasonable with the grommet theme as well.
For the HPE theme, this will be resolved with the icon sizing work Taylor is doing.
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.
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.
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!
What does this PR do?
Adds a
busy
prop to button to support an animation while button is loading or waiting for something. The animation also indicates when the button action succeeds.Where should the reviewer start?
What testing has been done on this PR?
Added a story
How should this be manually tested?
Do Jest tests follow these best practices?
Planning to go back in and add a jest test
screen
is used for querying.userEvent
is used in place offireEvent
.asFragment()
is used for snapshot testing.Any background context you want to provide?
What are the relevant issues?
grommet/hpe-design-system#3090
closes grommet/hpe-design-system#3174
Screenshots (if appropriate)
Do the grommet docs need to be updated?
Yes
Should this PR be mentioned in the release notes?
Yes
Is this change backwards compatible or is it a breaking change?
backwards compatible