From 3f2d0de6753758553245deb437579320da9288eb Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Wed, 11 Oct 2017 20:12:56 +0300 Subject: [PATCH] LandingPage uses TopbarContainer --- src/containers/LandingPage/LandingPage.js | 82 ++----------------- .../__snapshots__/LandingPage.test.js.snap | 23 +----- 2 files changed, 8 insertions(+), 97 deletions(-) diff --git a/src/containers/LandingPage/LandingPage.js b/src/containers/LandingPage/LandingPage.js index 8395cff7..1333371e 100644 --- a/src/containers/LandingPage/LandingPage.js +++ b/src/containers/LandingPage/LandingPage.js @@ -3,12 +3,10 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import { injectIntl, intlShape } from 'react-intl'; -import { sendVerificationEmail } from '../../ducks/user.duck'; -import { logout, authenticationInProgress } from '../../ducks/Auth.duck'; -import { manageDisableScrolling, isScrollingDisabled } from '../../ducks/UI.duck'; -import * as propTypes from '../../util/propTypes'; +import { isScrollingDisabled } from '../../ducks/UI.duck'; import config from '../../config'; -import { Page, HeroSection, Topbar } from '../../components'; +import { Page, HeroSection } from '../../components'; +import { TopbarContainer } from '../../containers'; import facebookImage from '../../assets/saunatimeFacebook-1200x630.jpg'; import twitterImage from '../../assets/saunatimeTwitter-600x314.jpg'; @@ -17,22 +15,11 @@ import css from './LandingPage.css'; export const LandingPageComponent = props => { const { authInfoError, - authInProgress, - currentUser, - currentUserHasListings, - currentUserHasOrders, history, intl, - isAuthenticated, location, logoutError, - notificationCount, - onLogout, - onManageDisableScrolling, scrollingDisabled, - sendVerificationEmailInProgress, - sendVerificationEmailError, - onResendVerificationEmail, } = props; // Schema for search engines (helps them to understand what this page is about) @@ -68,22 +55,7 @@ export const LandingPageComponent = props => { ` } > - - +
@@ -93,30 +65,15 @@ export const LandingPageComponent = props => { LandingPageComponent.defaultProps = { authInfoError: null, - currentUser: null, - currentUserHasOrders: null, logoutError: null, - notificationCount: 0, - sendVerificationEmailError: null, }; -const { bool, func, instanceOf, number, object } = PropTypes; +const { bool, instanceOf, object } = PropTypes; LandingPageComponent.propTypes = { authInfoError: instanceOf(Error), - authInProgress: bool.isRequired, - currentUser: propTypes.currentUser, - currentUserHasListings: bool.isRequired, - currentUserHasOrders: bool, - isAuthenticated: bool.isRequired, logoutError: instanceOf(Error), - notificationCount: number, - onLogout: func.isRequired, - onManageDisableScrolling: func.isRequired, scrollingDisabled: bool.isRequired, - sendVerificationEmailInProgress: bool.isRequired, - sendVerificationEmailError: instanceOf(Error), - onResendVerificationEmail: func.isRequired, // from withRouter history: object.isRequired, @@ -127,39 +84,14 @@ LandingPageComponent.propTypes = { }; const mapStateToProps = state => { - const { authInfoError, isAuthenticated, logoutError } = state.Auth; - const { - currentUser, - currentUserHasListings, - currentUserHasOrders, - currentUserNotificationCount: notificationCount, - sendVerificationEmailInProgress, - sendVerificationEmailError, - } = state.user; + const { authInfoError, logoutError } = state.Auth; return { authInfoError, - authInProgress: authenticationInProgress(state), - currentUser, - currentUserHasListings, - currentUserHasOrders, - isAuthenticated, logoutError, - notificationCount, scrollingDisabled: isScrollingDisabled(state), - sendVerificationEmailInProgress, - sendVerificationEmailError, }; }; -const mapDispatchToProps = dispatch => ({ - onLogout: historyPush => dispatch(logout(historyPush)), - onManageDisableScrolling: (componentId, disableScrolling) => - dispatch(manageDisableScrolling(componentId, disableScrolling)), - onResendVerificationEmail: () => dispatch(sendVerificationEmail()), -}); - -const LandingPage = compose(connect(mapStateToProps, mapDispatchToProps), injectIntl, withRouter)( - LandingPageComponent -); +const LandingPage = compose(connect(mapStateToProps), injectIntl, withRouter)(LandingPageComponent); export default LandingPage; diff --git a/src/containers/LandingPage/__snapshots__/LandingPage.test.js.snap b/src/containers/LandingPage/__snapshots__/LandingPage.test.js.snap index f8a4bc05..d52623cd 100644 --- a/src/containers/LandingPage/__snapshots__/LandingPage.test.js.snap +++ b/src/containers/LandingPage/__snapshots__/LandingPage.test.js.snap @@ -35,28 +35,7 @@ exports[`LandingPage matches snapshot 1`] = ` }, ] }> - +