Put availability behind an env varaible

This commit is contained in:
Hannu Lyytikainen 2018-08-16 17:45:23 +03:00
parent 91d4c808de
commit a293c144fe
3 changed files with 9 additions and 3 deletions

View file

@ -9,7 +9,6 @@ REACT_APP_STRIPE_PUBLISHABLE_KEY=
#
REACT_APP_SHARETRIBE_SDK_BASE_URL=http://localhost:8088
REACT_APP_SHARETRIBE_MARKETPLACE_CURRENCY=USD
REACT_APP_CANONICAL_ROOT_URL=http://localhost:3000
@ -29,4 +28,10 @@ REACT_APP_ENV=production
# REACT_APP_CSP=report
# BASIC_AUTH_USERNAME=sharetribe
# BASIC_AUTH_PASSWORD=secret
# REACT_APP_GOOGLE_ANALYTICS_ID=change-me
# REACT_APP_GOOGLE_ANALYTICS_ID=change-me
# Features.
#
REACT_APP_AVAILABILITY_ENABLED=true

View file

@ -22,6 +22,7 @@ them have defaults that work for development environment. For production deploys
| BASIC_AUTH_USERNAME | Set to enable HTTP Basic Auth |
| BASIC_AUTH_PASSWORD | Set to enable HTTP Basic Auth |
| REACT_APP_GOOGLE_ANALYTICS_ID | See: [Google Analytics](./analytics.md) |
| REACT_APP_AVAILABILITY_ENABLED | Enables availability calendar for listings. |
## Defining configuration

View file

@ -38,7 +38,7 @@ const bookingUnitType = 'line-item/night';
// Should the application fetch available time slots (currently defined as
// start and end dates) to be shown on listing page.
const fetchAvailableTimeSlots = true;
const fetchAvailableTimeSlots = process.env.REACT_APP_AVAILABILITY_ENABLED === 'true';
// A maximum number of days forwards during which a booking can be made.
// This is limited due to Stripe holding funds up to 90 days from the