-
Notifications
You must be signed in to change notification settings - Fork 72
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
Update D&D action button loading behavior #5201
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Test summaryRun details
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud |
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.
Looks good overall! Just a best-practice suggestion on the ActionButton
component itself.
<Text marginLeft={icon && 1} fontWeight="semibold" fontSize={12}> | ||
{title} | ||
</Text> | ||
{title} | ||
</Button> | ||
); |
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.
Since you are extending all ButtonProps
in the interface now, you should be able to simplify this quite a bit just by passing all of those props along to the Button. A good best-practice for making custom components a true extension of the original.
const ActionButton = ({
title,
icon,
variant = "outline",
...props
}: ActionButtonProps) => (
<Button
size="xs"
variant={variant}
data-testid={`action-${title}`}
loadingText={title}
leftIcon={icon}
{...props}
>
{title}
</Button>
);
Test summaryRun details
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud |
Closes PROD-2547
Description Of Changes
Updates loading behavior on D&D action buttons; spinner now renders inside of button corresponding to action that's loading. Also adds loading state to discovery monitor table "Scan" action button.
Previous behavior:
Screen.Recording.2024-08-15.at.09.20.16.mov
New behavior:
Screen.Recording.2024-08-15.at.09.20.48.mov
Code Changes
Pre-Merge Checklist
CHANGELOG.md