Skip to content

Commit

Permalink
fix(Extensions): Fix patternfly-react imports to pull from the defaul…
Browse files Browse the repository at this point in the history
…t component file. (patternfly#860)
  • Loading branch information
jeff-phillips-18 authored and dtaylor113 committed Oct 30, 2018
1 parent e9e884f commit bb1afd3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/patternfly-3/.babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
preventFullImport: true,
transform: importName => {
const moduleDir = !modules ? 'esm' : 'js';
const srcDir = importName === 'helpers' ? 'common' : 'components';
const srcDir = importName === 'helpers' ? 'common' : `components/${importName}`;
return `patternfly-react/dist/${moduleDir}/${srcDir}/${importName}`;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Checkbox, helpers } from 'patternfly-react';
import { helpers, Form } from 'patternfly-react';

const FilterSidePanelCategoryItem = ({ children, className, icon, count, ...props }) => {
const classes = classNames('filter-panel-pf-category-item', className);

return (
<div className={classes}>
<Checkbox {...props}>
<Form.Checkbox {...props}>
{icon && <span className="item-icon">{icon}</span>}
{children}
{Number.isInteger(count) && <span className="item-count">{`(${count})`}</span>}
</Checkbox>
</Form.Checkbox>
</div>
);
};
Expand All @@ -27,15 +27,15 @@ FilterSidePanelCategoryItem.propTypes = {
/** Optional count of the items matching the filter */
count: PropTypes.number,
/** Properties passed on to the Checkbox */
...helpers.excludeKeys(Checkbox.propTypes, ['className', 'children'])
...helpers.excludeKeys(Form.Checkbox.propTypes, ['className', 'children'])
};

FilterSidePanelCategoryItem.defaultProps = {
children: null,
className: '',
icon: null,
count: null,
...helpers.excludeKeys(Checkbox.defaultProps, ['className', 'children'])
...helpers.excludeKeys(Form.Checkbox.defaultProps, ['className', 'children'])
};

export default FilterSidePanelCategoryItem;
2 changes: 2 additions & 0 deletions packages/patternfly-3/patternfly-react/src/common/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@ export const helpers = {
KEY_CODES,
KEYS
};

export default helpers;

0 comments on commit bb1afd3

Please sign in to comment.