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

Label allow bool corner prop #294

Merged
merged 2 commits into from
Jun 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"consistent-return": 0,
"no-confusing-arrow": 0,
"react/sort-comp": 1,
"valid-jsdoc": 0
"valid-jsdoc": 0,
"react/jsx-curly-spacing": 0
}
}
7 changes: 5 additions & 2 deletions src/elements/Label/Label.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Label(props) {
useKeyOnly(horizontal, 'horizontal'),
useKeyOnly(tag, 'tag'),
useValueAndKey(attached, 'attached'),
useValueAndKey(corner, 'corner'),
useKeyOrValueAndKey(corner, 'corner'),
useKeyOrValueAndKey(pointing, 'pointing'),
useKeyOrValueAndKey(ribbon, 'ribbon'),
circular && (children && 'circular' || 'empty circular'),
Expand Down Expand Up @@ -98,7 +98,10 @@ Label.propTypes = {
color: PropTypes.oneOf(Label._meta.props.colors),

/** Place the label in one of the upper corners . */
corner: PropTypes.oneOf(Label._meta.props.corner),
corner: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.oneOf(Label._meta.props.corner),
]),

/** Additional text with less emphasis. */
detail: PropTypes.string,
Expand Down
3 changes: 3 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"shallow": false,
"render": false,
"mount": false
},
"rules": {
"react/jsx-curly-spacing": 0
}
}
2 changes: 1 addition & 1 deletion test/specs/elements/Label/Label-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('Label Component', () => {
common.propValueOnlyToClassName(Label, 'size')

common.propKeyAndValueToClassName(Label, 'attached')
common.propKeyAndValueToClassName(Label, 'corner')

common.propKeyOrValueToClassName(Label, 'corner')
common.propKeyOrValueToClassName(Label, 'pointing')
common.propKeyOrValueToClassName(Label, 'ribbon')

Expand Down