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

[EuiButtonEmpty] Reduce icon in xs size #4759

Merged
merged 3 commits into from
Apr 27, 2021

Conversation

andreadelrio
Copy link
Contributor

@andreadelrio andreadelrio commented Apr 27, 2021

Summary

Reduce size of the icon in EuiButtonEmpty so that when the size is xs the icon's size is s.

Frame 12

This is one of the issues we're tracking on the Amsterdam Airtable.

Checklist

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4759/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

Code changes LGTM!

Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

Thanks @andreadelrio! 🎉

It makes sense to have a smaller icon for the EuiButtonEmpty when the size is xs.

I just have a few code suggestions.

@@ -67,6 +68,7 @@ export const EuiButtonContent: FunctionComponent<
textProps,
isLoading = false,
iconType,
size,
Copy link
Contributor

@elizabetdev elizabetdev Apr 27, 2021

Choose a reason for hiding this comment

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

The goal of this size prop is to change the EuiIcon size so it should be called iconSize. This way on the parent component we know it will only control the icon size. Also, we can tell what is the default size.

Suggested change
size,
iconSize = 'm',

Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of passing in iconSize should we allow all of iconProps? (We could still restrict the size prop within it too.)

Just wanted to bring it up because in other places where expose some but not all of an underlying component's props, we sometimes end up getting more requests to expose more and more of the API and then we end up with a messy hybrid system.

Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of passing in iconSize should we allow all of iconProps

It's a good question. This component is internal (not exported as part of EUI's top-level API), so any decisions here won't impact consumers or result in requests.

If we wanted to merge the icon props into iconProps, it'd be EuiIconProps + iconSide? Or iconSide would remain by itself?

Also, we could merge this and look at the API some more; we can change it as many times as we want without external impact.

Copy link
Contributor

Choose a reason for hiding this comment

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

The <EuiButtonContent /> is an inner component used in EuiButton and EuiButtonEmpty. It's not meant to be used by consumers, but I agree that we should be more consistent to not end up with a messy hybrid system. 🙂

With that said, if @andreadelrio is ok to refactor the code, I'm up for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I added this comment at the same time that @thompsongl added his comment. After reading his opinion I think is better to merge the PR as it is.

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't realize these are internal components in which case it's a lot easier to iterate on the API so merge away!

@thompsongl
Copy link
Contributor

Good ideas all around, @miukimiu. That's a better way to handle it.

@andreadelrio
Copy link
Contributor Author

@miukimiu thanks for the suggestions! much cleaner. I made the changes.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4759/

@thompsongl thompsongl self-requested a review April 27, 2021 18:22
Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

Thanks, @andreadelrio for making the changes! LGTM! 🎉

@andreadelrio andreadelrio merged commit cab21aa into elastic:master Apr 27, 2021
cchaos pushed a commit that referenced this pull request May 4, 2021
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.

5 participants