mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-27 09:13:14 +10:00
Pass time slots to BookingDatesForm
This commit is contained in:
parent
2563bfeb2d
commit
bcbeec8aef
5 changed files with 11 additions and 1 deletions
|
|
@ -197,6 +197,7 @@ export class ListingPageComponent extends Component {
|
|||
fetchReviewsError,
|
||||
sendEnquiryInProgress,
|
||||
sendEnquiryError,
|
||||
timeSlots,
|
||||
categoriesConfig,
|
||||
amenitiesConfig,
|
||||
} = this.props;
|
||||
|
|
@ -477,6 +478,7 @@ export class ListingPageComponent extends Component {
|
|||
handleBookButtonClick={handleBookButtonClick}
|
||||
handleMobileBookModalClose={handleMobileBookModalClose}
|
||||
onManageDisableScrolling={onManageDisableScrolling}
|
||||
timeSlots={timeSlots}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ const SectionBooking = props => {
|
|||
handleBookButtonClick,
|
||||
handleMobileBookModalClose,
|
||||
onManageDisableScrolling,
|
||||
timeSlots,
|
||||
} = props;
|
||||
const showClosedListingHelpText = listing.id && isClosed;
|
||||
return (
|
||||
|
|
@ -68,6 +69,7 @@ const SectionBooking = props => {
|
|||
onSubmit={handleBookingSubmit}
|
||||
price={price}
|
||||
isOwnListing={isOwnListing}
|
||||
timeSlots={timeSlots}
|
||||
/>
|
||||
) : null}
|
||||
</ModalInMobile>
|
||||
|
|
|
|||
|
|
@ -325,6 +325,7 @@ exports[`ListingPage matches snapshot 1`] = `
|
|||
|
||||
</span>
|
||||
}
|
||||
timeSlots={null}
|
||||
unitType="line-item/night"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import { string, bool } from 'prop-types';
|
||||
import { string, bool, arrayOf } from 'prop-types';
|
||||
import { compose } from 'redux';
|
||||
import { Form as FinalForm } from 'react-final-form';
|
||||
import { FormattedMessage, intlShape, injectIntl } from 'react-intl';
|
||||
|
|
@ -85,6 +85,7 @@ export class BookingDatesFormComponent extends Component {
|
|||
unitPrice,
|
||||
unitType,
|
||||
values,
|
||||
timeSlots,
|
||||
} = fieldRenderProps;
|
||||
const { startDate, endDate } = values && values.bookingDates ? values.bookingDates : {};
|
||||
|
||||
|
|
@ -160,6 +161,7 @@ export class BookingDatesFormComponent extends Component {
|
|||
focusedInput={this.state.focusedInput}
|
||||
onFocusedInputChange={this.onFocusedInputChange}
|
||||
format={null}
|
||||
timeSlots={timeSlots}
|
||||
useMobileMargins
|
||||
validate={composeValidators(
|
||||
required(requiredMessage),
|
||||
|
|
@ -197,6 +199,7 @@ BookingDatesFormComponent.defaultProps = {
|
|||
isOwnListing: false,
|
||||
startDatePlaceholder: null,
|
||||
endDatePlaceholder: null,
|
||||
timeSlots: null,
|
||||
};
|
||||
|
||||
BookingDatesFormComponent.propTypes = {
|
||||
|
|
@ -207,6 +210,7 @@ BookingDatesFormComponent.propTypes = {
|
|||
unitType: propTypes.bookingUnitType.isRequired,
|
||||
price: propTypes.money,
|
||||
isOwnListing: bool,
|
||||
timeSlots: arrayOf(propTypes.timeSlot),
|
||||
|
||||
// from injectIntl
|
||||
intl: intlShape.isRequired,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ exports[`BookingDatesForm matches snapshot without selected dates 1`] = `
|
|||
render={[Function]}
|
||||
startDatePlaceholder="today"
|
||||
submitButtonWrapperClassName={null}
|
||||
timeSlots={null}
|
||||
unitPrice={
|
||||
Money {
|
||||
"amount": 1099,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue