Skip to content

Conversation

ShimiSun
Copy link
Collaborator

What does this PR do?

It fixes the theme type of button.

Where should the reviewer start?

base.d.ts

What testing has been done on this PR?

local environment, tests

How should this be manually tested?

review the code

Do Jest tests follow these best practices?

N/A

Any background context you want to provide?

N/A

What are the relevant issues?

Follow up to a PR #5651 (I think)

Screenshots (if appropriate)

Do the grommet docs need to be updated?

Nope, it's all bugs.

Should this PR be mentioned in the release notes?

Yes, as a TS fix

Is this change backward compatible or is it a breaking change?

backward compatible

@ShimiSun ShimiSun requested a review from jcfilben August 24, 2022 18:55
@ShimiSun ShimiSun changed the title fix: theme types for button [TS] fix: theme types for button Aug 24, 2022
@ShimiSun ShimiSun changed the title [TS] fix: theme types for button [TS] fix: theme types of Button Aug 24, 2022
Comment on lines +199 to +205
disabled?:
| (ButtonKindType & {
default?: ButtonKindType;
primary?: ButtonKindType;
secondary?: ButtonKindType;
})
| ({ [key: string]: ButtonKindType } & { opacity?: OpacityType });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we just have this?

Suggested change
disabled?:
| (ButtonKindType & {
default?: ButtonKindType;
primary?: ButtonKindType;
secondary?: ButtonKindType;
})
| ({ [key: string]: ButtonKindType } & { opacity?: OpacityType });
disabled?: ({ [key: string]: ButtonKindType } & { opacity?: OpacityType });

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This structure mimics the current structure for active and hover.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok I'm fine moving forward with this then

@ShimiSun ShimiSun requested a review from jcfilben August 25, 2022 16:35
Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

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

Looks good!

@ericsoderberghp ericsoderberghp merged commit 3e7c343 into master Aug 25, 2022
@ericsoderberghp ericsoderberghp deleted the fix/theme-types branch August 25, 2022 18:27
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.

3 participants