mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Fix API changes: description can be null.
This commit is contained in:
parent
f09549b546
commit
f7837e3369
3 changed files with 7 additions and 7 deletions
|
|
@ -32,7 +32,7 @@ import { sendEnquiry, loadData, setInitialValues } from './ListingPage.duck';
|
|||
import SectionImages from './SectionImages';
|
||||
import SectionAvatar from './SectionAvatar';
|
||||
import SectionHeading from './SectionHeading';
|
||||
import SectionDescription from './SectionDescription';
|
||||
import SectionDescriptionMaybe from './SectionDescriptionMaybe';
|
||||
import SectionFeatures from './SectionFeatures';
|
||||
import SectionReviews from './SectionReviews';
|
||||
import SectionHost from './SectionHost';
|
||||
|
|
@ -438,7 +438,7 @@ export class ListingPageComponent extends Component {
|
|||
showContactUser={showContactUser}
|
||||
onContactUser={this.onContactUser}
|
||||
/>
|
||||
<SectionDescription description={description} />
|
||||
<SectionDescriptionMaybe description={description} />
|
||||
<SectionFeatures
|
||||
options={amenitiesConfig}
|
||||
selectedOptions={publicData.amenities}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import css from './ListingPage.css';
|
|||
|
||||
const MIN_LENGTH_FOR_LONG_WORDS_IN_DESCRIPTION = 20;
|
||||
|
||||
const SectionDescription = props => {
|
||||
const SectionDescriptionMaybe = props => {
|
||||
const { description } = props;
|
||||
return (
|
||||
return description ? (
|
||||
<div className={css.sectionDescription}>
|
||||
<h2 className={css.descriptionTitle}>
|
||||
<FormattedMessage id="ListingPage.descriptionTitle" />
|
||||
|
|
@ -20,7 +20,7 @@ const SectionDescription = props => {
|
|||
})}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
) : null;
|
||||
};
|
||||
|
||||
export default SectionDescription;
|
||||
export default SectionDescriptionMaybe;
|
||||
|
|
@ -146,7 +146,7 @@ const listingAttributes = shape({
|
|||
|
||||
const ownListingAttributes = shape({
|
||||
title: string.isRequired,
|
||||
description: string.isRequired,
|
||||
description: string,
|
||||
geolocation: propTypes.latlng,
|
||||
deleted: propTypes.value(false).isRequired,
|
||||
state: oneOf(LISTING_STATES).isRequired,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue