mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
chore: remove unnecesary prop
This commit is contained in:
parent
773b2d37a4
commit
ce994040d2
2 changed files with 13 additions and 12 deletions
|
@ -10,18 +10,14 @@ import classes from './packageList.scss';
|
|||
export default class PackageList extends React.Component {
|
||||
static propTypes = {
|
||||
packages: PropTypes.array,
|
||||
help: PropTypes.bool,
|
||||
};
|
||||
|
||||
renderPackages = () => {
|
||||
const { packages } = this.props;
|
||||
return (
|
||||
packages.length > 0 ? (
|
||||
<Fragment>
|
||||
<h1 className={classes.listTitle}>{'Available Packages'}</h1>
|
||||
{this.renderList()}
|
||||
</Fragment>
|
||||
) : null
|
||||
<Fragment>
|
||||
<h1 className={classes.listTitle}>{'Available Packages'}</h1>
|
||||
{this.renderList()}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -40,13 +36,18 @@ export default class PackageList extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { help } = this.props;
|
||||
return (
|
||||
<div className={"package-list-items"}>
|
||||
<div className={classes.pkgContainer}>
|
||||
{help ? <Help /> : this.renderPackages()}
|
||||
{this.hasPackages() ? this.renderPackages(): <Help /> }
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
hasPackages() {
|
||||
const {packages} = this.props;
|
||||
|
||||
return packages.length > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ class Home extends Component {
|
|||
isUserLoggedIn: PropTypes.bool.isRequired,
|
||||
packages: PropTypes.array.isRequired,
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
const { packages } = this.props;
|
||||
return (
|
||||
<div className={"container content"}>
|
||||
<PackageList help={packages.length < 1} packages={packages} />
|
||||
<PackageList packages={packages} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue