diff --git a/src/components/TransactionPanel/TransactionPanel.js b/src/components/TransactionPanel/TransactionPanel.js index e5779599..363e18f6 100644 --- a/src/components/TransactionPanel/TransactionPanel.js +++ b/src/components/TransactionPanel/TransactionPanel.js @@ -99,7 +99,7 @@ export class TransactionPanelComponent extends Component { this.scrollToMessage = this.scrollToMessage.bind(this); } - componentWillMount() { + componentDidMount() { this.isMobSaf = isMobileSafari(); } diff --git a/src/containers/CheckoutPage/CheckoutPage.js b/src/containers/CheckoutPage/CheckoutPage.js index 6e9d8fe2..48202d8c 100644 --- a/src/containers/CheckoutPage/CheckoutPage.js +++ b/src/containers/CheckoutPage/CheckoutPage.js @@ -110,7 +110,7 @@ export class CheckoutPageComponent extends Component { this.handleSubmit = this.handleSubmit.bind(this); } - componentWillMount() { + componentDidMount() { if (window) { this.loadInitialData(); } @@ -520,6 +520,31 @@ export class CheckoutPageComponent extends Component { const currentListing = ensureListing(listing); const currentAuthor = ensureUser(currentListing.author); + const listingTitle = currentListing.attributes.title; + const title = intl.formatMessage({ id: 'CheckoutPage.title' }, { listingTitle }); + + const pageProps = { title, scrollingDisabled }; + const topbar = ( +
+ + + + +
+ ); + + if (isLoading) { + return {topbar}; + } + const isOwnListing = currentUser && currentUser.id && @@ -583,9 +608,6 @@ export class CheckoutPageComponent extends Component { !isPaymentExpired ); - const listingTitle = currentListing.attributes.title; - const title = intl.formatMessage({ id: 'CheckoutPage.title' }, { listingTitle }); - const firstImage = currentListing.images && currentListing.images.length > 0 ? currentListing.images[0] : null; @@ -686,23 +708,6 @@ export class CheckoutPageComponent extends Component { ); } - const topbar = ( -
- - - - -
- ); - const unitType = config.bookingUnitType; const isNightly = unitType === LINE_ITEM_NIGHT; const isDaily = unitType === LINE_ITEM_DAY; @@ -721,12 +726,6 @@ export class CheckoutPageComponent extends Component { existingTransaction && existingTransaction.attributes.lastTransition === TRANSITION_ENQUIRE ); - const pageProps = { title, scrollingDisabled }; - - if (isLoading) { - return {topbar}; - } - // Get first and last name of the current user and use it in the StripePaymentForm to autofill the name field const userName = currentUser && currentUser.attributes diff --git a/src/containers/NotFoundPage/NotFoundPage.js b/src/containers/NotFoundPage/NotFoundPage.js index 84d0a412..a94cb40d 100644 --- a/src/containers/NotFoundPage/NotFoundPage.js +++ b/src/containers/NotFoundPage/NotFoundPage.js @@ -21,7 +21,8 @@ import { TopbarContainer } from '../../containers'; import css from './NotFoundPage.css'; export class NotFoundPageComponent extends Component { - componentWillMount() { + constructor(props) { + super(props); // The StaticRouter component used in server side rendering // provides the context object. We attach a `notfound` flag to // the context to tell the server to change the response status