Merge pull request #659 from sharetribe/fix-contact-modal

Bug fix for modal opening for unauthenticated user
This commit is contained in:
Vesa Luusua 2018-01-19 16:11:03 +02:00 committed by GitHub
commit 42e042c66f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -222,6 +222,7 @@ export class ListingPageComponent extends Component {
const {
unitType,
tab,
isAuthenticated,
currentUser,
getListing,
intl,
@ -583,7 +584,7 @@ export class ListingPageComponent extends Component {
<Modal
id="ListingPage.enquiry"
contentClassName={css.enquiryModalContent}
isOpen={this.state.enquiryModalOpen}
isOpen={isAuthenticated && this.state.enquiryModalOpen}
onClose={() => this.setState({ enquiryModalOpen: false })}
onManageDisableScrolling={onManageDisableScrolling}
>
@ -690,6 +691,7 @@ ListingPageComponent.propTypes = {
id: string.isRequired,
slug: string,
}).isRequired,
isAuthenticated: bool.isRequired,
currentUser: propTypes.currentUser,
getListing: func.isRequired,
onManageDisableScrolling: func.isRequired,
@ -706,6 +708,7 @@ ListingPageComponent.propTypes = {
};
const mapStateToProps = state => {
const { isAuthenticated } = state.Auth;
const {
showListingError,
reviews,
@ -722,6 +725,7 @@ const mapStateToProps = state => {
};
return {
isAuthenticated,
currentUser,
getListing,
scrollingDisabled: isScrollingDisabled(state),