Extract features section into separate file

This commit is contained in:
Kimmo Puputti 2018-04-10 14:48:59 +03:00
parent c0137ed602
commit 78da3969d8
4 changed files with 68 additions and 66 deletions

View file

@ -382,7 +382,7 @@
}
}
.featuresContainer {
.sectionFeatures {
padding: 0 24px;
margin-bottom: 32px;

View file

@ -32,7 +32,6 @@ import {
Footer,
UserCard,
Reviews,
PropertyGroup,
} from '../../components';
import { BookingDatesForm, TopbarContainer, EnquiryForm, NotFoundPage } from '../../containers';
@ -40,6 +39,7 @@ import { sendEnquiry, loadData, setInitialValues } from './ListingPage.duck';
import SectionImages from './SectionImages';
import SectionHeading from './SectionHeading';
import SectionDescription from './SectionDescription';
import SectionFeatures from './SectionFeatures';
import SectionRulesMaybe from './SectionRulesMaybe';
import SectionMapMaybe from './SectionMapMaybe';
import css from './ListingPage.css';
@ -479,19 +479,10 @@ export class ListingPageComponent extends Component {
onContactUser={this.onContactUser}
/>
<SectionDescription description={description} />
<div className={css.featuresContainer}>
<h2 className={css.featuresTitle}>
<FormattedMessage id="ListingPage.featuresTitle" />
</h2>
<PropertyGroup
id="ListingPage.amenities"
options={config.custom.amenities}
selectedOptions={publicData.amenities}
twoColumns={true}
/>
</div>
<SectionFeatures
options={config.custom.amenities}
selectedOptions={publicData.amenities}
/>
<SectionRulesMaybe publicData={publicData} />
<SectionMapMaybe
geolocation={geolocation}

View file

@ -0,0 +1,24 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { PropertyGroup } from '../../components';
import css from './ListingPage.css';
const SectionFeatures = props => {
const { options, selectedOptions } = props;
return (
<div className={css.sectionFeatures}>
<h2 className={css.featuresTitle}>
<FormattedMessage id="ListingPage.featuresTitle" />
</h2>
<PropertyGroup
id="ListingPage.amenities"
options={options}
selectedOptions={selectedOptions}
twoColumns={true}
/>
</div>
);
};
export default SectionFeatures;

View file

@ -195,57 +195,44 @@ exports[`ListingPage matches snapshot 1`] = `
<SectionDescription
description="listing1 description"
/>
<div>
<h2>
<FormattedMessage
id="ListingPage.featuresTitle"
values={Object {}}
/>
</h2>
<PropertyGroup
className={null}
id="ListingPage.amenities"
options={
Array [
Object {
"key": "towels",
"label": "Towels",
},
Object {
"key": "bathroom",
"label": "Bathroom",
},
Object {
"key": "swimming_pool",
"label": "Swimming pool",
},
Object {
"key": "own_drinks",
"label": "Own drinks allowed",
},
Object {
"key": "jacuzzi",
"label": "Jacuzzi",
},
Object {
"key": "audiovisual_entertainment",
"label": "Audiovisual entertainment",
},
Object {
"key": "barbeque",
"label": "Barbeque",
},
Object {
"key": "own_food_allowed",
"label": "Own food allowed",
},
]
}
rootClassName={null}
selectedOptions={Array []}
twoColumns={true}
/>
</div>
<SectionFeatures
options={
Array [
Object {
"key": "towels",
"label": "Towels",
},
Object {
"key": "bathroom",
"label": "Bathroom",
},
Object {
"key": "swimming_pool",
"label": "Swimming pool",
},
Object {
"key": "own_drinks",
"label": "Own drinks allowed",
},
Object {
"key": "jacuzzi",
"label": "Jacuzzi",
},
Object {
"key": "audiovisual_entertainment",
"label": "Audiovisual entertainment",
},
Object {
"key": "barbeque",
"label": "Barbeque",
},
Object {
"key": "own_food_allowed",
"label": "Own food allowed",
},
]
}
/>
<SectionRulesMaybe
className={null}
publicData={Object {}}