From ce994040d2633c82d0d447ef4519f8d6750c210a Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Fri, 11 Jan 2019 07:23:09 +0100 Subject: [PATCH] chore: remove unnecesary prop --- src/webui/components/PackageList/index.js | 21 +++++++++++---------- src/webui/pages/home/index.js | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/webui/components/PackageList/index.js b/src/webui/components/PackageList/index.js index 087f51401..c598f2199 100644 --- a/src/webui/components/PackageList/index.js +++ b/src/webui/components/PackageList/index.js @@ -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 ? ( - -

{'Available Packages'}

- {this.renderList()} -
- ) : null + +

{'Available Packages'}

+ {this.renderList()} +
); } @@ -40,13 +36,18 @@ export default class PackageList extends React.Component { } render() { - const { help } = this.props; return (
- {help ? : this.renderPackages()} + {this.hasPackages() ? this.renderPackages(): }
); } + + hasPackages() { + const {packages} = this.props; + + return packages.length > 0; + } } diff --git a/src/webui/pages/home/index.js b/src/webui/pages/home/index.js index ac082bd3b..e2661b3bf 100644 --- a/src/webui/pages/home/index.js +++ b/src/webui/pages/home/index.js @@ -8,12 +8,12 @@ class Home extends Component { isUserLoggedIn: PropTypes.bool.isRequired, packages: PropTypes.array.isRequired, }; - + render() { const { packages } = this.props; return (
- +
); }