import React, { Component } from 'react' import { connect } from 'react-redux' import { Helmet } from 'react-helmet' import Topbar from './Topbar' import Sidebar from './Sidebar' import Typography from 'material-ui/Typography' import Snackbar from 'material-ui/Snackbar' import Spinner from './Spinner' import { withStyles } from 'material-ui/styles' import { notify } from '../../actions' const styles = theme => ({ root: { flexGrow: 1, zIndex: 1, overflow: 'hidden', position: 'relative', display: 'flex' }, content: { flexGrow: 1, backgroundColor: theme.palette.background.default, padding: theme.spacing.unit * 3, minWidth: 0 }, toolbar: theme.mixins.toolbar, header: { marginBottom: 25 } }) class Base extends Component { render() { const { classes, app, onHideNotification } = this.props return (
{this.props.title}
{this.props.children}
) } } /** * * @param {*} state * @param {*} props */ const mapStateToProps = (state, props) => { return { app: state.app } } /** * * @param {*} state * @param {*} props */ const mapDispatchToProps = (dispatch, props) => ({ /** * */ onHideNotification() { dispatch(notify(null)) }, /** * */ onHideDialog() { console.log('hide dialog') } }) export default connect(mapStateToProps, mapDispatchToProps)(withStyles(styles)(Base))