mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -03:30
Integrate proptypes for our shared components.
- Fix unit tests. - Fix linter errors.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import './tabs.scss';
|
||||
|
||||
@@ -15,4 +16,18 @@ const Tab = ({ children, link, replace }) => (
|
||||
</li>
|
||||
);
|
||||
|
||||
Tab.propTypes = {
|
||||
children: PropTypes.oneOfType([
|
||||
PropTypes.arrayOf(PropTypes.node),
|
||||
PropTypes.node
|
||||
]).isRequired,
|
||||
link: PropTypes.string,
|
||||
replace: PropTypes.bool,
|
||||
};
|
||||
|
||||
Tab.defaultProps = {
|
||||
link: null,
|
||||
replace: false,
|
||||
};
|
||||
|
||||
export default Tab;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Button } from '@patternfly/react-core';
|
||||
import { TimesIcon } from '@patternfly/react-icons';
|
||||
@@ -35,4 +36,21 @@ const Tabs = ({ children, labelText, closeButton }) => (
|
||||
</div>
|
||||
);
|
||||
|
||||
Tabs.propTypes = {
|
||||
children: PropTypes.oneOfType([
|
||||
PropTypes.arrayOf(PropTypes.node),
|
||||
PropTypes.node
|
||||
]).isRequired,
|
||||
labelText: PropTypes.string,
|
||||
closeButton: PropTypes.shape({
|
||||
text: PropTypes.string,
|
||||
link: PropTypes.string,
|
||||
}),
|
||||
};
|
||||
|
||||
Tabs.defaultProps = {
|
||||
labelText: null,
|
||||
closeButton: null,
|
||||
};
|
||||
|
||||
export default Tabs;
|
||||
|
||||
Reference in New Issue
Block a user