Switch to redux and webpack
This commit is contained in:
parent
b247287075
commit
e389454535
97 changed files with 2722 additions and 2656 deletions
34
client/src/js/containers/App.js
Normal file
34
client/src/js/containers/App.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { pushPath } from 'redux-simple-router';
|
||||
import pure from 'pure-render-decorator';
|
||||
import TabList from '../components/TabList';
|
||||
import * as actions from '../actions/tab';
|
||||
|
||||
@pure
|
||||
class App extends Component {
|
||||
render() {
|
||||
const { showMenu, children } = this.props;
|
||||
const mainClass = showMenu ? 'main-container off-canvas' : 'main-container';
|
||||
return (
|
||||
<div>
|
||||
<TabList {...this.props} />
|
||||
<div className={mainClass}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
servers: state.servers,
|
||||
channels: state.channels,
|
||||
privateChats: state.privateChats,
|
||||
showMenu: state.showMenu,
|
||||
selected: state.tab.selected
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, { pushPath, ...actions })(App);
|
Loading…
Add table
Add a link
Reference in a new issue