import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; import Helmet from 'react-helmet'; import { Topbar } from '../../containers'; const scrollToTop = () => { // Todo: this might need fine tuning later window.scrollTo(0, 0); }; class PageLayout extends Component { componentDidMount() { this.historyUnlisten = this.context.history.listen(() => scrollToTop()); } componentWillUnmount() { this.historyUnlisten(); } render() { const { className, title, children, loginError, logoutError } = this.props; // TODO: use FlashMessages for loginError/logoutError return (
Error in login: {loginError}
: null} {logoutError ?Error in logout: {logoutError}
: null}