diff --git a/docs/env.md b/docs/env.md index e55d0e0a7f..34fdd12720 100644 --- a/docs/env.md +++ b/docs/env.md @@ -3,7 +3,7 @@ The following configuration variables can be set to control the Flex template app behaviour. Most of them have defaults that work for development environment. For production deploys most should be set. -| Variable | Description | +| Variable | Description | | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | REACT_APP_MAPBOX_ACCESS_TOKEN | See: [Integrating to map providers](./map-providers.md) | | REACT_APP_GOOGLE_MAPS_API_KEY | See: [Google Maps API key](./google-maps.md) (Alternative map provider) | @@ -24,7 +24,7 @@ them have defaults that work for development environment. For production deploys | REACT_APP_GOOGLE_ANALYTICS_ID | See: [Google Analytics](./analytics.md) | | REACT_APP_AVAILABILITY_ENABLED | Enables availability calendar for listings. | | REACT_APP_DEFAULT_SEARCHES_ENABLED | Enables default search suggestions in location autocomplete search input. | -| REACT_APP_SHARETRIBE_SDK_BASE_URL | The base url to access the Sharetribe Flex Marketplace API. FTW uses the correct one by default so no need to set this. | +| REACT_APP_SHARETRIBE_SDK_BASE_URL | The base url to access the Sharetribe Flex Marketplace API. FTW uses the correct one by default so no need to set this. | ## Defining configuration diff --git a/docs/google-maps.md b/docs/google-maps.md index 79759acf00..340dac642f 100644 --- a/docs/google-maps.md +++ b/docs/google-maps.md @@ -67,16 +67,16 @@ comments. _public/index.html:_ ```html - - - - - + + + + + ``` ### 2. Searching with Google's geocoding API diff --git a/docs/icons.md b/docs/icons.md index d240496619..999475aee4 100644 --- a/docs/icons.md +++ b/docs/icons.md @@ -28,15 +28,15 @@ set if icons and an HTML snippet to point to those images. **Example HTML snippet:** ```html - - - - - - - - - + + + + + + + + + ``` ## Map marker icon diff --git a/package.json b/package.json index 48d9cce40a..47ca367940 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "nodemon": "^1.17.2", "nsp": "^3.2.1", "nsp-preprocessor-yarn": "^1.0.1", - "prettier": "^1.11.1" + "prettier": "^1.15.3" }, "scripts": { "clean": "rm -rf build/*", diff --git a/src/Routes.js b/src/Routes.js index af6a18a13e..f8e2ea0532 100644 --- a/src/Routes.js +++ b/src/Routes.js @@ -187,4 +187,7 @@ const mapStateToProps = state => { // lifecycle hook. // // See: https://github.com/ReactTraining/react-router/issues/4671 -export default compose(withRouter, connect(mapStateToProps))(Routes); +export default compose( + withRouter, + connect(mapStateToProps) +)(Routes); diff --git a/src/components/BookingBreakdown/LineItemUnitPrice.js b/src/components/BookingBreakdown/LineItemUnitPrice.js index dc908f127b..980fd43ab6 100644 --- a/src/components/BookingBreakdown/LineItemUnitPrice.js +++ b/src/components/BookingBreakdown/LineItemUnitPrice.js @@ -12,8 +12,8 @@ const LineItemUnitPrice = props => { const translationKey = isNightly ? 'BookingBreakdown.pricePerNight' : isDaily - ? 'BookingBreakdown.pricePerDay' - : 'BookingBreakdown.pricePerQuantity'; + ? 'BookingBreakdown.pricePerDay' + : 'BookingBreakdown.pricePerQuantity'; const unitPurchase = transaction.attributes.lineItems.find( item => item.code === unitType && !item.reversal diff --git a/src/components/Discussion/Discussion.js b/src/components/Discussion/Discussion.js index a50aa6d1ce..e7664d63e8 100644 --- a/src/components/Discussion/Discussion.js +++ b/src/components/Discussion/Discussion.js @@ -43,7 +43,11 @@ class Discussion extends Component { render() { return (
- +
{ const variant = isPendingApproval ? LISTING_PAGE_PENDING_APPROVAL_VARIANT : isDraft - ? LISTING_PAGE_DRAFT_VARIANT - : null; + ? LISTING_PAGE_DRAFT_VARIANT + : null; const linkProps = !!variant ? { name: 'ListingPageVariant', diff --git a/src/components/ManageListingCard/ManageListingCard.js b/src/components/ManageListingCard/ManageListingCard.js index ca43cc10d8..d56ba962eb 100644 --- a/src/components/ManageListingCard/ManageListingCard.js +++ b/src/components/ManageListingCard/ManageListingCard.js @@ -68,8 +68,8 @@ const createListingURL = (routes, listing) => { const variant = isDraft ? LISTING_PAGE_DRAFT_VARIANT : isPendingApproval - ? LISTING_PAGE_PENDING_APPROVAL_VARIANT - : null; + ? LISTING_PAGE_PENDING_APPROVAL_VARIANT + : null; const linkProps = isPendingApproval || isDraft @@ -359,4 +359,7 @@ ManageListingCardComponent.propTypes = { }).isRequired, }; -export default compose(withRouter, injectIntl)(ManageListingCardComponent); +export default compose( + withRouter, + injectIntl +)(ManageListingCardComponent); diff --git a/src/components/Map/StaticGoogleMap.js b/src/components/Map/StaticGoogleMap.js index 3be7576c3b..9c6a63102a 100644 --- a/src/components/Map/StaticGoogleMap.js +++ b/src/components/Map/StaticGoogleMap.js @@ -91,8 +91,8 @@ class StaticGoogleMap extends Component { const targetMaybe = mapsConfig.fuzzy.enabled ? { path: drawFuzzyCircle(mapsConfig, center) } : mapsConfig.customMarker.enabled - ? { markers: customMarker(mapsConfig.customMarker, lat, lng) } - : { markers: `${lat},${lng}` }; + ? { markers: customMarker(mapsConfig.customMarker, lat, lng) } + : { markers: `${lat},${lng}` }; const srcParams = stringify({ center: encodeLatLng(center), diff --git a/src/components/RangeSlider/RangeSlider.js b/src/components/RangeSlider/RangeSlider.js index 8e9cb151cd..63f64cbb27 100644 --- a/src/components/RangeSlider/RangeSlider.js +++ b/src/components/RangeSlider/RangeSlider.js @@ -33,14 +33,14 @@ class RangeSliderComponent extends Component { const width = dimensions.width; const valueOffset = value - min; const scale = max - min; - return Math.round(valueOffset / scale * width); + return Math.round((valueOffset / scale) * width); } toValue(position) { const { dimensions, min, max, step } = this.props; const width = dimensions.width; const scale = max - min; - const value = Math.round(position / width * scale) + min; + const value = Math.round((position / width) * scale) + min; return Math.ceil(value / step) * step; } diff --git a/src/components/SearchFilters/SearchFilters.js b/src/components/SearchFilters/SearchFilters.js index 4bd1906f1d..b49bc269a2 100644 --- a/src/components/SearchFilters/SearchFilters.js +++ b/src/components/SearchFilters/SearchFilters.js @@ -229,6 +229,9 @@ SearchFiltersComponent.propTypes = { intl: intlShape.isRequired, }; -const SearchFilters = compose(withRouter, injectIntl)(SearchFiltersComponent); +const SearchFilters = compose( + withRouter, + injectIntl +)(SearchFiltersComponent); export default SearchFilters; diff --git a/src/components/SearchMap/SearchMapWithMapbox.js b/src/components/SearchMap/SearchMapWithMapbox.js index ba32f672f1..c8f0609b36 100644 --- a/src/components/SearchMap/SearchMapWithMapbox.js +++ b/src/components/SearchMap/SearchMapWithMapbox.js @@ -148,8 +148,8 @@ const priceLabelsInLocations = ( const infoCardOpenIds = Array.isArray(infoCardOpen) ? infoCardOpen.map(l => l.id.uuid) : infoCardOpen - ? [infoCardOpen.id.uuid] - : []; + ? [infoCardOpen.id.uuid] + : []; // if the listing is open, don't print price label if (infoCardOpen != null && infoCardOpenIds.includes(listing.id.uuid)) { @@ -400,22 +400,24 @@ class SearchMapWithMapbox extends Component { // SearchMapPriceLabel and SearchMapGroupLabel: // create a new marker or use existing one if markerId is among previously rendered markers - this.currentMarkers = labels.filter(v => v != null).map(m => { - const existingMarkerId = this.currentMarkers.findIndex( - marker => m.markerId === marker.markerId && marker.marker - ); + this.currentMarkers = labels + .filter(v => v != null) + .map(m => { + const existingMarkerId = this.currentMarkers.findIndex( + marker => m.markerId === marker.markerId && marker.marker + ); - if (existingMarkerId >= 0) { - const { marker, markerContainer, ...rest } = this.currentMarkers[existingMarkerId]; - return { ...rest, ...m, markerContainer, marker }; - } else { - const markerContainer = document.createElement('div'); - markerContainer.setAttribute('id', m.markerId); - markerContainer.classList.add(css.labelContainer); - const marker = createMarker(m, markerContainer); - return { ...m, markerContainer, marker }; - } - }); + if (existingMarkerId >= 0) { + const { marker, markerContainer, ...rest } = this.currentMarkers[existingMarkerId]; + return { ...rest, ...m, markerContainer, marker }; + } else { + const markerContainer = document.createElement('div'); + markerContainer.setAttribute('id', m.markerId); + markerContainer.classList.add(css.labelContainer); + const marker = createMarker(m, markerContainer); + return { ...m, markerContainer, marker }; + } + }); /* Create marker for SearchMapInfoCard component */ if (infoCardOpen) { diff --git a/src/components/Topbar/Topbar.js b/src/components/Topbar/Topbar.js index 0cd974a821..d6fa2ba6e1 100644 --- a/src/components/Topbar/Topbar.js +++ b/src/components/Topbar/Topbar.js @@ -326,7 +326,10 @@ TopbarComponent.propTypes = { intl: intlShape.isRequired, }; -const Topbar = compose(withViewport, injectIntl)(TopbarComponent); +const Topbar = compose( + withViewport, + injectIntl +)(TopbarComponent); Topbar.displayName = 'Topbar'; diff --git a/src/components/TransactionPanel/TransactionPanel.helpers.js b/src/components/TransactionPanel/TransactionPanel.helpers.js index 1f79e0af58..b47c3fc989 100644 --- a/src/components/TransactionPanel/TransactionPanel.helpers.js +++ b/src/components/TransactionPanel/TransactionPanel.helpers.js @@ -100,8 +100,8 @@ export const AddressLinkMaybe = props => { const hrefToGoogleMaps = geolocation ? `https://maps.google.com/?q=${lat},${lng}` : address - ? `https://maps.google.com/?q=${encodeURIComponent(address)}` - : null; + ? `https://maps.google.com/?q=${encodeURIComponent(address)}` + : null; const fullAddress = typeof building === 'string' && building.length > 0 ? `${building}, ${address}` : address; diff --git a/src/containers/AuthenticationPage/AuthenticationPage.js b/src/containers/AuthenticationPage/AuthenticationPage.js index 75875c252d..b9e711cd04 100644 --- a/src/containers/AuthenticationPage/AuthenticationPage.js +++ b/src/containers/AuthenticationPage/AuthenticationPage.js @@ -324,7 +324,10 @@ const mapDispatchToProps = dispatch => ({ // See: https://github.com/ReactTraining/react-router/issues/4671 const AuthenticationPage = compose( withRouter, - connect(mapStateToProps, mapDispatchToProps), + connect( + mapStateToProps, + mapDispatchToProps + ), injectIntl )(AuthenticationPageComponent); diff --git a/src/containers/CheckoutPage/CheckoutPage.js b/src/containers/CheckoutPage/CheckoutPage.js index abbb57d547..5a52633906 100644 --- a/src/containers/CheckoutPage/CheckoutPage.js +++ b/src/containers/CheckoutPage/CheckoutPage.js @@ -532,9 +532,14 @@ const mapDispatchToProps = dispatch => ({ fetchSpeculatedTransaction: params => dispatch(speculateTransaction(params)), }); -const CheckoutPage = compose(withRouter, connect(mapStateToProps, mapDispatchToProps), injectIntl)( - CheckoutPageComponent -); +const CheckoutPage = compose( + withRouter, + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(CheckoutPageComponent); CheckoutPage.setInitialValues = initialValues => setInitialValues(initialValues); diff --git a/src/containers/ContactDetailsPage/ContactDetailsPage.js b/src/containers/ContactDetailsPage/ContactDetailsPage.js index fbe5d2fb22..b99a7e0f14 100644 --- a/src/containers/ContactDetailsPage/ContactDetailsPage.js +++ b/src/containers/ContactDetailsPage/ContactDetailsPage.js @@ -167,9 +167,13 @@ const mapDispatchToProps = dispatch => ({ onSubmitContactDetails: values => dispatch(saveContactDetails(values)), }); -const ContactDetailsPage = compose(connect(mapStateToProps, mapDispatchToProps), injectIntl)( - ContactDetailsPageComponent -); +const ContactDetailsPage = compose( + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(ContactDetailsPageComponent); ContactDetailsPage.loadData = () => { // Since verify email happens in separate tab, current user's data might be updated diff --git a/src/containers/EditListingPage/EditListingPage.js b/src/containers/EditListingPage/EditListingPage.js index 800f3974c0..0013202381 100644 --- a/src/containers/EditListingPage/EditListingPage.js +++ b/src/containers/EditListingPage/EditListingPage.js @@ -271,9 +271,13 @@ const mapDispatchToProps = dispatch => ({ // lifecycle hook. // // See: https://github.com/ReactTraining/react-router/issues/4671 -const EditListingPage = compose(withRouter, connect(mapStateToProps, mapDispatchToProps))( - injectIntl(EditListingPageComponent) -); +const EditListingPage = compose( + withRouter, + connect( + mapStateToProps, + mapDispatchToProps + ) +)(injectIntl(EditListingPageComponent)); EditListingPage.loadData = loadData; diff --git a/src/containers/EmailVerificationPage/EmailVerificationPage.js b/src/containers/EmailVerificationPage/EmailVerificationPage.js index 609cacf4c2..b869670861 100644 --- a/src/containers/EmailVerificationPage/EmailVerificationPage.js +++ b/src/containers/EmailVerificationPage/EmailVerificationPage.js @@ -138,7 +138,10 @@ const mapDispatchToProps = dispatch => ({ // See: https://github.com/ReactTraining/react-router/issues/4671 const EmailVerificationPage = compose( withRouter, - connect(mapStateToProps, mapDispatchToProps), + connect( + mapStateToProps, + mapDispatchToProps + ), injectIntl )(EmailVerificationPageComponent); diff --git a/src/containers/InboxPage/InboxPage.js b/src/containers/InboxPage/InboxPage.js index efab92f0e1..c4c94a3205 100644 --- a/src/containers/InboxPage/InboxPage.js +++ b/src/containers/InboxPage/InboxPage.js @@ -419,7 +419,10 @@ const mapStateToProps = state => { }; }; -const InboxPage = compose(connect(mapStateToProps), injectIntl)(InboxPageComponent); +const InboxPage = compose( + connect(mapStateToProps), + injectIntl +)(InboxPageComponent); InboxPage.loadData = loadData; diff --git a/src/containers/LandingPage/LandingPage.js b/src/containers/LandingPage/LandingPage.js index bd6b1055cf..d87a1ac9f1 100644 --- a/src/containers/LandingPage/LandingPage.js +++ b/src/containers/LandingPage/LandingPage.js @@ -107,6 +107,10 @@ const mapStateToProps = state => { // lifecycle hook. // // See: https://github.com/ReactTraining/react-router/issues/4671 -const LandingPage = compose(withRouter, connect(mapStateToProps), injectIntl)(LandingPageComponent); +const LandingPage = compose( + withRouter, + connect(mapStateToProps), + injectIntl +)(LandingPageComponent); export default LandingPage; diff --git a/src/containers/ListingPage/ListingPage.js b/src/containers/ListingPage/ListingPage.js index f5a4266712..6d8cf8412b 100644 --- a/src/containers/ListingPage/ListingPage.js +++ b/src/containers/ListingPage/ListingPage.js @@ -620,9 +620,14 @@ const mapDispatchToProps = dispatch => ({ // lifecycle hook. // // See: https://github.com/ReactTraining/react-router/issues/4671 -const ListingPage = compose(withRouter, connect(mapStateToProps, mapDispatchToProps), injectIntl)( - ListingPageComponent -); +const ListingPage = compose( + withRouter, + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(ListingPageComponent); ListingPage.setInitialValues = initialValues => setInitialValues(initialValues); ListingPage.loadData = loadData; diff --git a/src/containers/ManageListingsPage/ManageListingsPage.js b/src/containers/ManageListingsPage/ManageListingsPage.js index fb2751fa22..af650d6e72 100644 --- a/src/containers/ManageListingsPage/ManageListingsPage.js +++ b/src/containers/ManageListingsPage/ManageListingsPage.js @@ -231,9 +231,13 @@ const mapDispatchToProps = dispatch => ({ onOpenListing: listingId => dispatch(openListing(listingId)), }); -const ManageListingsPage = compose(connect(mapStateToProps, mapDispatchToProps), injectIntl)( - ManageListingsPageComponent -); +const ManageListingsPage = compose( + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(ManageListingsPageComponent); ManageListingsPage.loadData = (params, search) => { const queryParams = parse(search); diff --git a/src/containers/NotFoundPage/NotFoundPage.js b/src/containers/NotFoundPage/NotFoundPage.js index 4be7a3ec10..84d0a41257 100644 --- a/src/containers/NotFoundPage/NotFoundPage.js +++ b/src/containers/NotFoundPage/NotFoundPage.js @@ -107,8 +107,10 @@ const mapStateToProps = state => { // lifecycle hook. // // See: https://github.com/ReactTraining/react-router/issues/4671 -const NotFoundPage = compose(withRouter, connect(mapStateToProps), injectIntl)( - NotFoundPageComponent -); +const NotFoundPage = compose( + withRouter, + connect(mapStateToProps), + injectIntl +)(NotFoundPageComponent); export default NotFoundPage; diff --git a/src/containers/PasswordChangePage/PasswordChangePage.js b/src/containers/PasswordChangePage/PasswordChangePage.js index 7117eb6db3..444502ca61 100644 --- a/src/containers/PasswordChangePage/PasswordChangePage.js +++ b/src/containers/PasswordChangePage/PasswordChangePage.js @@ -142,8 +142,12 @@ const mapDispatchToProps = dispatch => ({ onSubmitChangePassword: values => dispatch(changePassword(values)), }); -const PasswordChangePage = compose(connect(mapStateToProps, mapDispatchToProps), injectIntl)( - PasswordChangePageComponent -); +const PasswordChangePage = compose( + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(PasswordChangePageComponent); export default PasswordChangePage; diff --git a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js index 40c95b233d..79ed79c649 100644 --- a/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js +++ b/src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js @@ -224,8 +224,12 @@ const mapDispatchToProps = dispatch => ({ onRetypeEmail: () => dispatch(retypePasswordRecoveryEmail()), }); -const PasswordRecoveryPage = compose(connect(mapStateToProps, mapDispatchToProps), injectIntl)( - PasswordRecoveryPageComponent -); +const PasswordRecoveryPage = compose( + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(PasswordRecoveryPageComponent); export default PasswordRecoveryPage; diff --git a/src/containers/PasswordResetPage/PasswordResetPage.js b/src/containers/PasswordResetPage/PasswordResetPage.js index 54518f2622..4d49862b4b 100644 --- a/src/containers/PasswordResetPage/PasswordResetPage.js +++ b/src/containers/PasswordResetPage/PasswordResetPage.js @@ -180,7 +180,10 @@ const mapDispatchToProps = dispatch => ({ // See: https://github.com/ReactTraining/react-router/issues/4671 const PasswordResetPage = compose( withRouter, - connect(mapStateToProps, mapDispatchToProps), + connect( + mapStateToProps, + mapDispatchToProps + ), injectIntl )(PasswordResetPageComponent); diff --git a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js index 322d09a1a8..320bbbf9ac 100644 --- a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js +++ b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js @@ -160,9 +160,13 @@ const mapDispatchToProps = dispatch => ({ onPayoutDetailsFormSubmit: values => dispatch(savePayoutDetails(values)), }); -const PayoutPreferencesPage = compose(connect(mapStateToProps, mapDispatchToProps), injectIntl)( - PayoutPreferencesPageComponent -); +const PayoutPreferencesPage = compose( + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(PayoutPreferencesPageComponent); PayoutPreferencesPage.loadData = loadData; diff --git a/src/containers/PrivacyPolicyPage/PrivacyPolicyPage.js b/src/containers/PrivacyPolicyPage/PrivacyPolicyPage.js index f3bb60f8df..464ece07fb 100644 --- a/src/containers/PrivacyPolicyPage/PrivacyPolicyPage.js +++ b/src/containers/PrivacyPolicyPage/PrivacyPolicyPage.js @@ -83,6 +83,9 @@ const mapStateToProps = state => { }; }; -const PrivacyPolicyPage = compose(connect(mapStateToProps), injectIntl)(PrivacyPolicyPageComponent); +const PrivacyPolicyPage = compose( + connect(mapStateToProps), + injectIntl +)(PrivacyPolicyPageComponent); export default PrivacyPolicyPage; diff --git a/src/containers/ProfilePage/ProfilePage.js b/src/containers/ProfilePage/ProfilePage.js index 492db36ce2..71f009ce57 100644 --- a/src/containers/ProfilePage/ProfilePage.js +++ b/src/containers/ProfilePage/ProfilePage.js @@ -313,9 +313,11 @@ const mapStateToProps = state => { }; }; -const ProfilePage = compose(connect(mapStateToProps), withViewport, injectIntl)( - ProfilePageComponent -); +const ProfilePage = compose( + connect(mapStateToProps), + withViewport, + injectIntl +)(ProfilePageComponent); ProfilePage.loadData = params => { const id = new UUID(params.id); diff --git a/src/containers/ProfileSettingsPage/ProfileSettingsPage.js b/src/containers/ProfileSettingsPage/ProfileSettingsPage.js index e1d9a744bc..db8918a2fa 100644 --- a/src/containers/ProfileSettingsPage/ProfileSettingsPage.js +++ b/src/containers/ProfileSettingsPage/ProfileSettingsPage.js @@ -177,8 +177,12 @@ const mapDispatchToProps = dispatch => ({ onUpdateProfile: data => dispatch(updateProfile(data)), }); -const ProfileSettingsPage = compose(connect(mapStateToProps, mapDispatchToProps), injectIntl)( - ProfileSettingsPageComponent -); +const ProfileSettingsPage = compose( + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(ProfileSettingsPageComponent); export default ProfileSettingsPage; diff --git a/src/containers/SearchPage/SearchPage.js b/src/containers/SearchPage/SearchPage.js index 6eb29032bd..1b67184c68 100644 --- a/src/containers/SearchPage/SearchPage.js +++ b/src/containers/SearchPage/SearchPage.js @@ -332,9 +332,14 @@ const mapDispatchToProps = dispatch => ({ // lifecycle hook. // // See: https://github.com/ReactTraining/react-router/issues/4671 -const SearchPage = compose(withRouter, connect(mapStateToProps, mapDispatchToProps), injectIntl)( - SearchPageComponent -); +const SearchPage = compose( + withRouter, + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(SearchPageComponent); SearchPage.loadData = (params, search) => { const queryParams = parse(search, { diff --git a/src/containers/StyleguidePage/StyleguidePage.js b/src/containers/StyleguidePage/StyleguidePage.js index 6843dc01f0..510f6045c5 100644 --- a/src/containers/StyleguidePage/StyleguidePage.js +++ b/src/containers/StyleguidePage/StyleguidePage.js @@ -196,7 +196,9 @@ const StyleguidePage = props => { const html = examples.length > 0 ? ( ) : (

diff --git a/src/containers/TermsOfServicePage/TermsOfServicePage.js b/src/containers/TermsOfServicePage/TermsOfServicePage.js index a43247d738..015c28ea10 100644 --- a/src/containers/TermsOfServicePage/TermsOfServicePage.js +++ b/src/containers/TermsOfServicePage/TermsOfServicePage.js @@ -83,8 +83,9 @@ const mapStateToProps = state => { }; }; -const TermsOfServicePage = compose(connect(mapStateToProps), injectIntl)( - TermsOfServicePageComponent -); +const TermsOfServicePage = compose( + connect(mapStateToProps), + injectIntl +)(TermsOfServicePageComponent); export default TermsOfServicePage; diff --git a/src/containers/TopbarContainer/TopbarContainer.js b/src/containers/TopbarContainer/TopbarContainer.js index 15ad4fc39d..aba4bb5e4b 100644 --- a/src/containers/TopbarContainer/TopbarContainer.js +++ b/src/containers/TopbarContainer/TopbarContainer.js @@ -124,8 +124,12 @@ const mapDispatchToProps = dispatch => ({ // lifecycle hook. // // See: https://github.com/ReactTraining/react-router/issues/4671 -const TopbarContainer = compose(withRouter, connect(mapStateToProps, mapDispatchToProps))( - TopbarContainerComponent -); +const TopbarContainer = compose( + withRouter, + connect( + mapStateToProps, + mapDispatchToProps + ) +)(TopbarContainerComponent); export default TopbarContainer; diff --git a/src/containers/TransactionPage/TransactionPage.js b/src/containers/TransactionPage/TransactionPage.js index 02cc4a4fd6..0ba4a089e2 100644 --- a/src/containers/TransactionPage/TransactionPage.js +++ b/src/containers/TransactionPage/TransactionPage.js @@ -282,9 +282,13 @@ const mapDispatchToProps = dispatch => { }; }; -const TransactionPage = compose(connect(mapStateToProps, mapDispatchToProps), injectIntl)( - TransactionPageComponent -); +const TransactionPage = compose( + connect( + mapStateToProps, + mapDispatchToProps + ), + injectIntl +)(TransactionPageComponent); TransactionPage.loadData = loadData; TransactionPage.setInitialValues = setInitialValues; diff --git a/src/forms/BookingDatesForm/EstimatedBreakdownMaybe.js b/src/forms/BookingDatesForm/EstimatedBreakdownMaybe.js index a8f846d82d..c4507e2f1d 100644 --- a/src/forms/BookingDatesForm/EstimatedBreakdownMaybe.js +++ b/src/forms/BookingDatesForm/EstimatedBreakdownMaybe.js @@ -64,8 +64,8 @@ const estimatedTransaction = (unitType, bookingStart, bookingEnd, unitPrice, qua const unitCount = isNightly ? nightsBetween(bookingStart, bookingEnd) : isDaily - ? daysBetween(bookingStart, bookingEnd) - : quantity; + ? daysBetween(bookingStart, bookingEnd) + : quantity; const totalPrice = estimatedTotalPrice(unitPrice, unitCount); diff --git a/src/util/contextHelpers.js b/src/util/contextHelpers.js index 9f82c90623..97c745f6e4 100644 --- a/src/util/contextHelpers.js +++ b/src/util/contextHelpers.js @@ -141,8 +141,8 @@ export const withDimensions = (Component, options = {}) => { clientWidth !== 0 && clientHeight !== 0 ? { width: clientWidth, height: clientHeight } : width !== 0 && height !== 0 - ? { width, height } - : {}; + ? { width, height } + : {}; const props = { ...this.props, dimensions: currentDimensions }; diff --git a/src/util/maps.js b/src/util/maps.js index ac142880c3..61057d281b 100644 --- a/src/util/maps.js +++ b/src/util/maps.js @@ -62,7 +62,7 @@ const obfuscatedCoordinatesImpl = (latlng, cacheKey) => { lng + Math.atan2(sinBearing * sinTheta * cosLat, cosTheta - sinLat * Math.sin(newLat)); // Normalize -PI -> +PI radians - const newLngNormalized = (newLng + THREE_PI) % TWO_PI - Math.PI; + const newLngNormalized = ((newLng + THREE_PI) % TWO_PI) - Math.PI; const result = radToDegrees({ lat: newLat, lng: newLngNormalized }); return new LatLng(result.lat, result.lng); @@ -129,26 +129,26 @@ export const circlePolyline = (latlng, radius) => { const R = 6371; const pi = Math.PI; - const _lat = lat * pi / 180; - const _lng = lng * pi / 180; + const _lat = (lat * pi) / 180; + const _lng = (lng * pi) / 180; const d = radius / 1000 / R; let points = []; for (let i = 0; i <= 360; i += detail) { - const brng = i * pi / 180; + const brng = (i * pi) / 180; let pLat = Math.asin( Math.sin(_lat) * Math.cos(d) + Math.cos(_lat) * Math.sin(d) * Math.cos(brng) ); const pLng = - (_lng + + ((_lng + Math.atan2( Math.sin(brng) * Math.sin(d) * Math.cos(_lat), Math.cos(d) - Math.sin(_lat) * Math.sin(pLat) )) * - 180 / + 180) / pi; - pLat = pLat * 180 / pi; + pLat = (pLat * 180) / pi; points.push([pLat, pLng]); } diff --git a/yarn.lock b/yarn.lock index 74460c9e0f..c3ac804d20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6649,9 +6649,10 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^1.11.1: - version "1.12.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325" +prettier@^1.15.3: + version "1.15.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.3.tgz#1feaac5bdd181237b54dbe65d874e02a1472786a" + integrity sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg== pretty-bytes@^4.0.2: version "4.0.2"