Add booking help text for closed booking

This commit is contained in:
Hannu Lyytikainen 2017-09-06 14:49:25 +03:00 committed by Kimmo Puputti
parent 2748d68773
commit e0d206df21
2 changed files with 17 additions and 7 deletions

View file

@ -222,13 +222,20 @@ export class ListingPageComponent extends Component {
</div>
: null;
const showClosedListingHelpText = currentListing.id && !currentListing.attributes.open;
const bookingHeading = (
<div className={css.bookingHeading}>
<h2 className={css.bookingTitle}>
<FormattedMessage id="ListingPage.bookingTitle" values={{ title }} />
</h2>
<div className={css.bookingHelp}>
<FormattedMessage id="ListingPage.bookingHelp" />
<FormattedMessage
id={
showClosedListingHelpText
? 'ListingPage.bookingHelpClosedListing'
: 'ListingPage.bookingHelp'
}
/>
</div>
</div>
);
@ -366,12 +373,14 @@ export class ListingPageComponent extends Component {
</div>
{bookingHeading}
<BookingDatesForm
className={css.bookingForm}
onSubmit={handleBookingSubmit}
price={price}
isOwnListing={isOwnListing}
/>
{currentListing.attributes.open
? <BookingDatesForm
className={css.bookingForm}
onSubmit={handleBookingSubmit}
price={price}
isOwnListing={isOwnListing}
/>
: null}
</ModalInMobile>
<div className={css.openBookingForm}>
<div className={css.priceContainer}>

View file

@ -143,6 +143,7 @@
"ListingCard.unsupportedPrice": "({currency})",
"ListingCard.unsupportedPriceTitle": "Unsupported currency ({currency})",
"ListingPage.bookingHelp": "Start by choosing your dates.",
"ListingPage.bookingHelpClosedListing": "Sorry, this listing has been closed.",
"ListingPage.bookingTitle": "Book {title}",
"ListingPage.closedListing": "This listing has been closed and can't be booked.",
"ListingPage.ctaButtonMessage": "Request to book",