cra + mui + redux + reactrouter
This commit is contained in:
33
src/components/general/application_bar.js
Normal file
33
src/components/general/application_bar.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import React, { Component } from 'react';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
import AppBar from 'material-ui/AppBar';
|
||||
import UserDisplay from '../user/user_display';
|
||||
|
||||
class ApplicationBar extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
}
|
||||
}
|
||||
render() {
|
||||
|
||||
return (
|
||||
<AppBar
|
||||
title={this.props.appBar.title}
|
||||
iconElementRight={<UserDisplay />}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
function mapStateToProps(state, props) {
|
||||
return {
|
||||
appBar: state.appBar
|
||||
};
|
||||
}
|
||||
function mapDispatchToProps(dispatch) {
|
||||
return {
|
||||
/* actions: bindActionCreators(cartActions, dispatch) */
|
||||
}
|
||||
}
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(ApplicationBar);
|
||||
Reference in New Issue
Block a user