Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
feat(footer): deprecate for v10 (#1960)
Browse files Browse the repository at this point in the history
Fixes #1956.
  • Loading branch information
asudoh authored and joshblack committed Mar 8, 2019
1 parent d9b17c7 commit fbedcae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Footer/Footer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import Footer from '../Footer';
import { mount } from 'enzyme';

describe('Footer', () => {
describeBreakingChangesXFeatures('Footer', () => {
describe('Renders as expected', () => {
const footer = mount(
<Footer
Expand Down
15 changes: 14 additions & 1 deletion src/components/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ import PropTypes from 'prop-types';
import React from 'react';
import classnames from 'classnames';
import { settings } from 'carbon-components';
import warning from 'warning';
import { breakingChangesX } from '../../internal/FeatureFlags';
import Link from '../Link';
import Button from '../Button';

const { prefix } = settings;

let didWarnAboutDeprecation = false;

const Footer = ({
className,
children,
Expand All @@ -26,6 +30,15 @@ const Footer = ({
buttonText,
...other
}) => {
if (__DEV__) {
warning(
didWarnAboutDeprecation,
'The `Footer` component has been deprecated and will be removed ' +
'in the next major release of `carbon-components-react`.'
);
didWarnAboutDeprecation = true;
}

const classNames = classnames(
`${prefix}--footer ${prefix}--footer--bottom-fixed`,
className
Expand Down Expand Up @@ -113,4 +126,4 @@ Footer.defaultProps = {
buttonText: 'Create',
};

export default Footer;
export default (!breakingChangesX ? Footer : null);

0 comments on commit fbedcae

Please sign in to comment.