Skip to content

buttonType and default of type button - #54

Merged
bevacqua merged 7 commits into
masterfrom
button-type-button
Oct 26, 2017
Merged

bevacqua merged 7 commits into
masterfrom
button-type-button

Conversation

@bevacqua

Copy link
Copy Markdown
Contributor

Fixes #3 and #53

pugnascotia
pugnascotia previously approved these changes Oct 25, 2017

@pugnascotia pugnascotia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/components/button/button.js Outdated
size,
fill,
isDisabled,
buttonType = 'button',

Copy link
Copy Markdown
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?

@cjcenizal cjcenizal Oct 25, 2017 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

@cjcenizal cjcenizal left a comment

Copy link
Copy Markdown
Contributor

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.


<EuiButtonEmpty
type="text"
color="text"

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/components/call_out/call_out.js Outdated

EuiCallOut.defaultProps = {
type: 'info',
color: 'info',

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread src/components/toast/toast.js Outdated

const typeToClassNameMap = {
const colorToClassNameMap = {
info: 'euiToast--info',

Copy link
Copy Markdown
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
Copy Markdown
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

@cjcenizal cjcenizal left a comment

Copy link
Copy Markdown
Contributor

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
@snide snide added the breaking change PRs with breaking changes. (Don't delete - used for automation) label Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PRs with breaking changes. (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants