-
Notifications
You must be signed in to change notification settings - Fork 843
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
EuiButton, EuiButtonEmpty and EuiButtonIcon can now take an HREF #316
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Just had a few really minor comments.
CHANGELOG.md
Outdated
@@ -1,6 +1,10 @@ | |||
# [`master`](https://github.com/elastic/eui/tree/master) | |||
|
|||
No public interface changes since `0.0.13`. | |||
- EuiButton, EuiButtonEmpty and EuiButtonIcon can now take an HREF [(#316)](https://github.com/elastic/eui/pull/316) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit: can we change "HREF" to be:
`href`
(using back ticks for code-formatting)
src/components/button/button.js
Outdated
@@ -32,6 +33,15 @@ const iconSideToClassNameMap = { | |||
|
|||
export const ICON_SIDES = Object.keys(iconSideToClassNameMap); | |||
|
|||
// const checkHrefAndOnClick = (props, propName, componentName) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Kiiiiillll... meeeeee......" - this code
src/components/button/button.js
Outdated
if (href) { | ||
return ( | ||
<a | ||
disabled={isDisabled} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to googles, disabled
isn't a valid attribute on anchor tags.
if (href) { | ||
return ( | ||
<a | ||
disabled={isDisabled} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
if (href) { | ||
return ( | ||
<a | ||
disabled={isDisabled} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
Feedback addressed. Gonna wait for tests to pass then I'll merge. |
jenkins, test this |
Looks like we're still having build problems on github. Merging this though because it's fairly simple / tested locally. |
Closes #24
Used a pattern @cjcenizal used in KUI. Moved the function to a new folder of
/services/prop-types/
since we'll likely have more of these kind of reusable prop checks in the future.