diff --git a/src/components/EditListingWizard/EditListingWizard.js b/src/components/EditListingWizard/EditListingWizard.js index 6871dc51..4dc5b903 100644 --- a/src/components/EditListingWizard/EditListingWizard.js +++ b/src/components/EditListingWizard/EditListingWizard.js @@ -3,6 +3,7 @@ import { array, bool, func, number, object, oneOf, shape, string } from 'prop-ty import { compose } from 'redux'; import { FormattedMessage, injectIntl, intlShape } from 'react-intl'; import classNames from 'classnames'; +import config from '../../config'; import { withViewport } from '../../util/contextHelpers'; import { LISTING_PAGE_PARAM_TYPE_DRAFT, @@ -24,9 +25,20 @@ import EditListingWizardTab, { } from './EditListingWizardTab'; import css from './EditListingWizard.css'; +// Show availability calendar only if environment variable availabilityEnabled is true +const availabilityMaybe = config.enableAvailability ? [AVAILABILITY] : []; + // TODO: PHOTOS panel needs to be the last one since it currently contains PayoutDetailsForm modal // All the other panels can be reordered. -export const TABS = [DESCRIPTION, FEATURES, POLICY, LOCATION, PRICING, AVAILABILITY, PHOTOS]; +export const TABS = [ + DESCRIPTION, + FEATURES, + POLICY, + LOCATION, + PRICING, + ...availabilityMaybe, + PHOTOS, +]; // Tabs are horizontal in small screens const MAX_HORIZONTAL_NAV_SCREEN_WIDTH = 1023;