Skip to content
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(Toolbar): replaced spacer props with gap #648

Merged
merged 2 commits into from
May 29, 2024

Conversation

thatblindgeye
Copy link
Collaborator

Closes #645

Copy link
Contributor

@adamviktora adamviktora left a comment

Choose a reason for hiding this comment

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

Overall LGTM, I really like the automation in the test file - we might take that as a template for other future rules.

One change request bellow and one unused import, otherwise all good.

if (spacerProp) {
spacerVal &&
spacerVal.forEach((val: Property) => {
const newValue =
Copy link
Contributor

Choose a reason for hiding this comment

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

newValue can be false here, which could be a problem in a use case like this:

const NO_SPACER = "spacerNone";
<ToolbarItem spacer={{ default: NO_SPACER }} />

which results to:

const NO_SPACER = "spacerNone";
<ToolbarItem spacer={{ default: "false" }} />

I don't think we need to attempt to change the variable value to gapNone, because this is a very rare use case and probably nobody uses it like this. But I think the variable name should stay there so we don't mess up with consumer's code just in case.

Copy link
Contributor

@adamviktora adamviktora left a comment

Choose a reason for hiding this comment

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

🎉

@adamviktora adamviktora merged commit 2c73046 into patternfly:main May 29, 2024
3 checks passed
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.

Toolbar - updates spacers to gaps
2 participants