UNPKG

admin-on-rest-fr05t1k

Version:

A frontend Framework for building admin applications on top of REST services, using ES6, React and Material UI

31 lines (26 loc) 801 B
import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import MuiAppBar from 'material-ui/AppBar'; import muiThemeable from 'material-ui/styles/muiThemeable'; import compose from 'recompose/compose'; import { toggleSidebar as toggleSidebarAction } from '../../actions'; const AppBar = ({ title, toggleSidebar }) => ( <MuiAppBar title={title} onLeftIconButtonTouchTap={toggleSidebar} /> ); AppBar.propTypes = { title: PropTypes.oneOfType([ PropTypes.string, PropTypes.element ]).isRequired, toggleSidebar: PropTypes.func.isRequired, }; const enhance = compose( muiThemeable(), // force redraw on theme change connect(null, { toggleSidebar: toggleSidebarAction, }), ); export default enhance(AppBar);