From e91d3341be944940a7bbd058ff037404db3fe5c1 Mon Sep 17 00:00:00 2001 From: Chris Lawton <chris.lawton@torchbox.com> Date: Tue, 29 Jan 2019 11:56:51 +0000 Subject: [PATCH] pass column prop to listing component --- .../src/app/src/components/GroupedListing/index.js | 2 +- opentech/static_src/src/app/src/components/Listing/index.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/opentech/static_src/src/app/src/components/GroupedListing/index.js b/opentech/static_src/src/app/src/components/GroupedListing/index.js index 28efdf199..e8eb8a79a 100644 --- a/opentech/static_src/src/app/src/components/GroupedListing/index.js +++ b/opentech/static_src/src/app/src/components/GroupedListing/index.js @@ -127,7 +127,7 @@ export default class GroupedListing extends React.Component { /> } </div> - <Listing {...passProps} listRef={this.listRef} /> + <Listing {...passProps} listRef={this.listRef} column="applications" /> </div> ); } diff --git a/opentech/static_src/src/app/src/components/Listing/index.js b/opentech/static_src/src/app/src/components/Listing/index.js index e7a7cf04e..d92464958 100644 --- a/opentech/static_src/src/app/src/components/Listing/index.js +++ b/opentech/static_src/src/app/src/components/Listing/index.js @@ -17,6 +17,7 @@ export default class Listing extends React.Component { renderItem: PropTypes.func.isRequired, handleRetry: PropTypes.func, listRef: PropTypes.object, + column: PropTypes.string, }; renderListItems() { @@ -25,6 +26,8 @@ export default class Listing extends React.Component { isLoading, items, renderItem, + column, + listRef, } = this.props; if (isLoading) { @@ -44,7 +47,7 @@ export default class Listing extends React.Component { } return ( - <ul className="listing__list" ref={this.props.listRef}> + <ul className={`listing__list listing__list--${column}`} ref={listRef}> {items.map(v => renderItem(v))} </ul> ); -- GitLab