mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Use enableAvailability in ManageListingCard
This commit is contained in:
parent
1d15936bae
commit
44e69bf36c
2 changed files with 16 additions and 8 deletions
|
|
@ -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 => {
|
|||
<FormattedMessage id="ManageListingCard.editListing" />
|
||||
</NamedLink>
|
||||
|
||||
<span className={css.manageLinksSeparator}>{' • '}</span>
|
||||
{availabilityEnabled ? (
|
||||
<React.Fragment>
|
||||
<span className={css.manageLinksSeparator}>{' • '}</span>
|
||||
|
||||
<NamedLink
|
||||
className={css.manageLink}
|
||||
name="EditListingPage"
|
||||
params={{ id, slug, type: 'edit', tab: 'availability' }}
|
||||
>
|
||||
<FormattedMessage id="ManageListingCard.manageAvailability" />
|
||||
</NamedLink>
|
||||
<NamedLink
|
||||
className={css.manageLink}
|
||||
name="EditListingPage"
|
||||
params={{ id, slug, type: editListingLinkType, tab: 'availability' }}
|
||||
>
|
||||
<FormattedMessage id="ManageListingCard.manageAvailability" />
|
||||
</NamedLink>
|
||||
</React.Fragment>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ describe('ManageListingCard', () => {
|
|||
onToggleMenu={noop}
|
||||
hasClosingError={false}
|
||||
hasOpeningError={false}
|
||||
availabilityEnabled={true}
|
||||
/>
|
||||
);
|
||||
expect(tree).toMatchSnapshot();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue