From 67f8bd92e446ad68effd604f5c4766ee16233e2e Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Tue, 16 May 2017 23:00:36 +0200 Subject: [PATCH] format with prettier --- server/index.js | 2 +- .../EditListingPricingPanel.js | 6 +----- src/components/ListingCard/ListingCard.js | 4 +++- src/components/ListingCardSmall/ListingCardSmall.js | 4 +++- .../EditListingLocationForm.js | 2 +- .../EditListingPhotosForm/EditListingPhotosForm.js | 11 ++--------- src/containers/ListingPage/ListingPage.js | 9 ++++++--- 7 files changed, 17 insertions(+), 21 deletions(-) diff --git a/server/index.js b/server/index.js index 087ec529..78b62dc2 100644 --- a/server/index.js +++ b/server/index.js @@ -129,7 +129,7 @@ app.get('*', (req, res) => { }); app.listen(PORT, () => { - const mode = dev ? "development" : "production"; + const mode = dev ? 'development' : 'production'; console.log(`Listening to port ${PORT} in ${mode} mode`); if (dev) { console.log(`Open http://localhost:${PORT}/ and start hacking!`); diff --git a/src/components/EditListingPricingPanel/EditListingPricingPanel.js b/src/components/EditListingPricingPanel/EditListingPricingPanel.js index 70e9586f..d7379ca0 100644 --- a/src/components/EditListingPricingPanel/EditListingPricingPanel.js +++ b/src/components/EditListingPricingPanel/EditListingPricingPanel.js @@ -15,11 +15,7 @@ const EditListingPricingPanel = props => { return (

- +
); }; diff --git a/src/components/ListingCard/ListingCard.js b/src/components/ListingCard/ListingCard.js index c6a64aca..872cbf5a 100644 --- a/src/components/ListingCard/ListingCard.js +++ b/src/components/ListingCard/ListingCard.js @@ -37,7 +37,9 @@ export const ListingCardComponent = props => { : []; const mainImage = images.length > 0 ? images[0] : null; const imageURL = mainImage ? mainImage.sizes.find(i => i.name === 'landscape-crop').url : null; - const image2XURL = mainImage ? mainImage.sizes.find(i => i.name === 'landscape-crop2x').url : null; + const image2XURL = mainImage + ? mainImage.sizes.find(i => i.name === 'landscape-crop2x').url + : null; const higherRes = image2XURL ? { srcSet: `${image2XURL} 2x` } : null; // TODO: svg should have own loading strategy diff --git a/src/components/ListingCardSmall/ListingCardSmall.js b/src/components/ListingCardSmall/ListingCardSmall.js index c8b52f56..d04c9752 100644 --- a/src/components/ListingCardSmall/ListingCardSmall.js +++ b/src/components/ListingCardSmall/ListingCardSmall.js @@ -36,7 +36,9 @@ export const ListingCardSmallComponent = props => { : []; const mainImage = images.length > 0 ? images[0] : null; const imageURL = mainImage ? mainImage.sizes.find(i => i.name === 'landscape-crop').url : null; - const image2XURL = mainImage ? mainImage.sizes.find(i => i.name === 'landscape-crop2x').url : null; + const image2XURL = mainImage + ? mainImage.sizes.find(i => i.name === 'landscape-crop2x').url + : null; const higherRes = image2XURL ? { srcSet: `${image2XURL} 2x` } : null; // TODO: svg should have own loading strategy diff --git a/src/containers/EditListingLocationForm/EditListingLocationForm.js b/src/containers/EditListingLocationForm/EditListingLocationForm.js index 9bb10d0c..85d3b6b8 100644 --- a/src/containers/EditListingLocationForm/EditListingLocationForm.js +++ b/src/containers/EditListingLocationForm/EditListingLocationForm.js @@ -49,7 +49,7 @@ export class EditListingLocationFormComponent extends Component { const classes = classNames(css.root, className); return ( -
+ ({ id: i.id, sizes: i.attributes.sizes })) : []; - // TODO: svg should have own loading strategy // Now noImageIcon is imported with default configuration (gives url) // This should be handled by ResponsiveImage or separate ImagePlaceholder component @@ -137,7 +136,11 @@ export class ListingPageComponent extends Component { // TODO componentize const imageCarousel = images.length > 0 ?
- {title} i.name === 'landscape-crop').url} /> + {title} i.name === 'landscape-crop').url} + />
{images.slice(1).map(image => (
@@ -160,7 +163,7 @@ export class ListingPageComponent extends Component { const showBookButton = !isOwnListing; const authorAvailable = currentListing && currentListing.author; - const authorProfile = authorAvailable && currentListing.author.attributes.profile + const authorProfile = authorAvailable && currentListing.author.attributes.profile; const authorName = authorAvailable ? `${authorProfile.firstName} ${authorProfile.lastName}` : '';