Skip to content

Commit

Permalink
Fix unknown prop warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed May 20, 2017
1 parent 21b1163 commit 455567c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/DropdownToggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class DropdownToggle extends PureComponent {
render() {
const {
componentClass: Component,
btnSize,
btnStyle = 'flat',
noCaret,
open,
className,
Expand All @@ -51,19 +53,19 @@ class DropdownToggle extends PureComponent {
delete props.dropdownRole; // Accessed by Dropdown

if (Component === Button) {
props.btnStyle = props.btnStyle || 'flat';
props.btnStyle = btnStyle;
props.dropdownToggle = true;
}

const useCaret = !noCaret;
const empty = !children && !props.title;
const dropdownToggleClasses = {
[styles.dropdownToggle]: true,
[styles.btnLink]: props.btnStyle === 'link',
[styles.btnLg]: props.btnSize === 'lg' || props.btnSize === 'large',
[styles.btnMd]: props.btnSize === 'md' || props.btnSize === 'medium',
[styles.btnSm]: props.btnSize === 'sm' || props.btnSize === 'small',
[styles.btnXs]: props.btnSize === 'xs' || props.btnSize === 'extra-small',
[styles.btnLink]: btnStyle === 'link', // CSS selector ".btn-link:hover .caret"
[styles.btnLg]: btnSize === 'lg' || btnSize === 'large',
[styles.btnMd]: btnSize === 'md' || btnSize === 'medium',
[styles.btnSm]: btnSize === 'sm' || btnSize === 'small',
[styles.btnXs]: btnSize === 'xs' || btnSize === 'extra-small',
[styles.empty]: empty
};
const caretClasses = {
Expand Down
2 changes: 1 addition & 1 deletion src/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
margin-bottom: 7px;
}
.dropdown-toggle.btn-link:hover .caret {
border-top-color: #0096cc;
border-top-color: #0096cc;
}
.dropdown-toggle.empty .caret {
margin-left: 0;
Expand Down

0 comments on commit 455567c

Please sign in to comment.