From 44e69bf36cd905b639b9288a93348fe5f479230a Mon Sep 17 00:00:00 2001 From: Jenni Nurmi Date: Wed, 16 Jan 2019 12:47:45 +0200 Subject: [PATCH] Use enableAvailability in ManageListingCard --- .../ManageListingCard/ManageListingCard.js | 23 ++++++++++++------- .../ManageListingCard.test.js | 1 + 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/ManageListingCard/ManageListingCard.js b/src/components/ManageListingCard/ManageListingCard.js index 732762b7..4c05e100 100644 --- a/src/components/ManageListingCard/ManageListingCard.js +++ b/src/components/ManageListingCard/ManageListingCard.js @@ -123,6 +123,7 @@ export const ManageListingCardComponent = props => { onOpenListing, onToggleMenu, renderSizes, + availabilityEnabled, } = props; const classes = classNames(rootClassName || css.root, className); const currentListing = ensureOwnListing(listing); @@ -335,15 +336,19 @@ export const ManageListingCardComponent = props => { - {' • '} + {availabilityEnabled ? ( + + {' • '} - - - + + + + + ) : null} @@ -355,6 +360,7 @@ ManageListingCardComponent.defaultProps = { rootClassName: null, actionsInProgressListingId: null, renderSizes: null, + availabilityEnabled: config.enableAvailability, }; const { bool, func, shape, string } = PropTypes; @@ -371,6 +377,7 @@ ManageListingCardComponent.propTypes = { onCloseListing: func.isRequired, onOpenListing: func.isRequired, onToggleMenu: func.isRequired, + availabilityEnabled: bool, // Responsive image sizes hint renderSizes: string, diff --git a/src/components/ManageListingCard/ManageListingCard.test.js b/src/components/ManageListingCard/ManageListingCard.test.js index 01a84801..801eb87d 100644 --- a/src/components/ManageListingCard/ManageListingCard.test.js +++ b/src/components/ManageListingCard/ManageListingCard.test.js @@ -18,6 +18,7 @@ describe('ManageListingCard', () => { onToggleMenu={noop} hasClosingError={false} hasOpeningError={false} + availabilityEnabled={true} /> ); expect(tree).toMatchSnapshot();