From 094f7d4f382188d939e28970c37161c4f1f6ed06 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Tue, 11 Jul 2017 18:03:58 +0300 Subject: [PATCH] SalePage: pass PageLayout props --- src/containers/SalePage/SalePage.js | 18 ++++++++++++++---- .../__snapshots__/SalePage.test.js.snap | 6 ++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/containers/SalePage/SalePage.js b/src/containers/SalePage/SalePage.js index 117ce330..b8a1ed44 100644 --- a/src/containers/SalePage/SalePage.js +++ b/src/containers/SalePage/SalePage.js @@ -25,6 +25,7 @@ import css from './SalePage.css'; // It show loading data text or SaleDetailsPanel (and later also another panel for messages). export const SalePageComponent = props => { const { + authInfoError, authInProgress, currentUser, currentUserHasListings, @@ -33,6 +34,7 @@ export const SalePageComponent = props => { intl, isAuthenticated, location, + logoutError, notificationCount, onAcceptSale, onLogout, @@ -91,6 +93,8 @@ export const SalePageComponent = props => { return ( @@ -114,8 +118,10 @@ export const SalePageComponent = props => { }; SalePageComponent.defaultProps = { + authInfoError: null, currentUser: null, fetchSaleError: null, + logoutError: null, notificationCount: 0, transaction: null, }; @@ -123,12 +129,14 @@ SalePageComponent.defaultProps = { const { bool, func, instanceOf, number, oneOf, shape, string } = PropTypes; SalePageComponent.propTypes = { + authInfoError: instanceOf(Error), authInProgress: bool.isRequired, currentUser: propTypes.currentUser, currentUserHasListings: bool.isRequired, fetchSaleError: instanceOf(Error), intl: intlShape.isRequired, isAuthenticated: bool.isRequired, + logoutError: instanceOf(Error), notificationCount: number, onAcceptSale: func.isRequired, onLogout: func.isRequired, @@ -150,7 +158,7 @@ SalePageComponent.propTypes = { const mapStateToProps = state => { const { fetchSaleError, transactionRef } = state.SalePage; - const { isAuthenticated } = state.Auth; + const { authInfoError, isAuthenticated, logoutError } = state.Auth; const { currentUser, currentUserHasListings, @@ -161,14 +169,16 @@ const mapStateToProps = state => { const transaction = transactions.length > 0 ? transactions[0] : null; return { - transaction, - fetchSaleError, - isAuthenticated, + authInfoError, authInProgress: authenticationInProgress(state), currentUser, currentUserHasListings, + fetchSaleError, + isAuthenticated, + logoutError, notificationCount, scrollingDisabled: isScrollingDisabled(state), + transaction, }; }; diff --git a/src/containers/SalePage/__snapshots__/SalePage.test.js.snap b/src/containers/SalePage/__snapshots__/SalePage.test.js.snap index a8139897..ad971538 100644 --- a/src/containers/SalePage/__snapshots__/SalePage.test.js.snap +++ b/src/containers/SalePage/__snapshots__/SalePage.test.js.snap @@ -1,5 +1,7 @@ exports[`SalePage matches snapshot 1`] = ` - - + `;