Skip to content

Commit

Permalink
[changed] Renamed Collapsable* => Collapsible*
Browse files Browse the repository at this point in the history
CollapsableMixin => CollaplibleMixin
CollapsableNav   => CollaplibleNav

More here react-bootstrap#425

Exactly this commit:
Add CollapsibleMixin to src/index.js
Refactor deprecationWarning() for general use.
  • Loading branch information
AlexKVal committed Apr 28, 2015
1 parent 0967d5a commit 0105127
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
13 changes: 9 additions & 4 deletions src/CollapsableMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,37 @@ import assign from './utils/Object.assign';
import deprecationWarning from './utils/deprecationWarning';
import CollapsibleMixin from './CollapsibleMixin';

let link = 'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963';

const CollapsableMixin = assign({}, CollapsibleMixin, {
getCollapsableClassSet(className) {
deprecationWarning(
'CollapsableMixin.getCollapsableClassSet()',
'CollapsibleMixin.getCollapsibleClassSet()'
'CollapsibleMixin.getCollapsibleClassSet()',
link
);
return CollapsibleMixin.getCollapsibleClassSet.call(this, className);
},

getCollapsibleDOMNode() {
deprecationWarning(
'CollapsableMixin.getCollapsableDOMNode()',
'CollapsibleMixin.getCollapsibleDOMNode()'
'CollapsibleMixin.getCollapsibleDOMNode()',
link
);
return this.getCollapsableDOMNode();
},

getCollapsibleDimensionValue() {
deprecationWarning(
'CollapsableMixin.getCollapsableDimensionValue()',
'CollapsibleMixin.getCollapsibleDimensionValue()'
'CollapsibleMixin.getCollapsibleDimensionValue()',
link
);
return this.getCollapsableDimensionValue();
}
});

deprecationWarning('CollapsableMixin', 'CollapsibleMixin');
deprecationWarning('CollapsableMixin', 'CollapsibleMixin', link);

export default CollapsableMixin;
6 changes: 5 additions & 1 deletion src/CollapsableNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import CollapsibleNav from './CollapsibleNav';

let CollapsableNav = CollapsibleNav;

deprecationWarning('CollapsableNav', 'CollapsibleNav');
deprecationWarning(
'CollapsableNav',
'CollapsibleNav',
'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'
);

export default CollapsableNav;
3 changes: 2 additions & 1 deletion src/CollapsibleMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ const CollapsibleMixin = {
if (typeof this.getCollapsableDimension === 'function') {
deprecationWarning(
'CollapsableMixin.getCollapsableDimension()',
'CollapsibleMixin.getCollapsibleDimension()'
'CollapsibleMixin.getCollapsibleDimension()',
'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'
);
return this.getCollapsableDimension();
}
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Carousel from './Carousel';
import CarouselItem from './CarouselItem';
import Col from './Col';
import CollapsableMixin from './CollapsableMixin';
import CollapsibleMixin from './CollapsibleMixin';
import DropdownButton from './DropdownButton';
import DropdownMenu from './DropdownMenu';
import DropdownStateMixin from './DropdownStateMixin';
Expand Down Expand Up @@ -66,6 +67,7 @@ export default {
CarouselItem,
Col,
CollapsableMixin,
CollapsibleMixin,
DropdownButton,
DropdownMenu,
DropdownStateMixin,
Expand Down
8 changes: 5 additions & 3 deletions src/utils/deprecationWarning.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export default function deprecationWarning(oldname, newname) {
export default function deprecationWarning(oldname, newname, link) {
if (process.env.NODE_ENV !== 'production') {
let message = `${oldname} is deprecated. Use ${newname} instead.`;
console.warn(message);
let link = 'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963';
console.warn(`You can read more about it here ${link}`);

if (link) {
console.warn(`You can read more about it here ${link}`);
}
}
}

0 comments on commit 0105127

Please sign in to comment.