-
Notifications
You must be signed in to change notification settings - Fork 322
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
feat(ModalFooterButtons): support disable buttons and remove secondary #2016
feat(ModalFooterButtons): support disable buttons and remove secondary #2016
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.
Seems cool by me 💪🏼
@talkor I was wondering if we should allow passing all props for each of the button
wdyt? should we consult design about it? as it is abusable
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! Thank you for contributing! Let's just remove the disableSecondaryButton
packages/core/src/components/Modal/ModalFooter/ModalFooterButtons/ModalFooterButtons.tsx
Outdated
Show resolved
Hide resolved
Yes it was the thought at first but designers don't want to give this flexibility for now |
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.
Awesome thanks!
}); | ||
fireEvent.click(modalFooterComponent.getByText(PRIMARY_BUTTON_TEXT)); | ||
expect(onPrimaryButtonClick).not.toBeCalled(); | ||
expect(onSecondaryButtonClick).not.toBeCalled(); |
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.
This is redundant no?
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.
this is a test to validate that the button is indeed disabled
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 mean just this line, there's nothing going on with the secondary button in this test, no?
Basic
npm run plop
) to create a new component.Style
NewComponent.modules.scss
file inside theNewComponent
folder.Storybook
/src/components/NewComponent/__stories__/NewComponent.mdx
file.Tests
Accessibility