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

buttonType and default of type button #54

Merged
merged 7 commits into from
Oct 26, 2017
Merged

Conversation

bevacqua
Copy link
Contributor

Fixes #3 and #53

pugnascotia
pugnascotia previously approved these changes Oct 25, 2017
Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -41,6 +41,7 @@ export const EuiButton = ({
size,
fill,
isDisabled,
buttonType = 'button',
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking we should rename the existing type prop to buttonType and use type for things like submit and button. This way it will just get passed through via the ...rest argument. What do you think?

Can we also use defaultProps to specify the default button value?

Copy link
Contributor

@cjcenizal cjcenizal Oct 25, 2017

Choose a reason for hiding this comment

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

The reason I think we should use buttonType this way is because a lot of our components could have "types", e.g. tables, modals, pretty much anything. We can use this naming pattern to name these props tableType, modalType, etc. This will let us avoid collisions with the native type attribute throughout our code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Looks great, just found a few outliers we should probably reconcile.

@@ -167,7 +167,7 @@ export default () => (
  

<EuiButtonEmpty
type="text"
color="text"
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm this is a little weird. I don't think most people will naturally associate a particular color or appearance with "text". Can we find a better name... "default" maybe? @snide Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is fine. "primary" isn't a color either.

};

EuiCallOut.defaultProps = {
type: 'info',
color: 'info',
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we rename "info" to "primary"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure.

};

EuiBadge.defaultProps = {
type: 'default',
color: 'default',
Copy link
Contributor

Choose a reason for hiding this comment

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

Here's precedent for "default".

Copy link
Contributor

Choose a reason for hiding this comment

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

Default in this case is the actual default though.

@@ -11,17 +11,17 @@ import {
EuiText,
} from '..';

const typeToClassNameMap = {
const colorToClassNameMap = {
info: 'euiToast--info',
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to "primary"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure.

snide
snide previously approved these changes Oct 26, 2017
cjcenizal
cjcenizal previously approved these changes Oct 26, 2017
Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

LGTM!

@bevacqua bevacqua dismissed stale reviews from cjcenizal and snide via 7dc3b9b October 26, 2017 17:00
snide
snide previously approved these changes Oct 26, 2017
@cjcenizal cjcenizal mentioned this pull request Oct 26, 2017
@bevacqua bevacqua merged commit 5214bec into master Oct 26, 2017
@bevacqua bevacqua deleted the button-type-button branch October 26, 2017 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants