Fix navicon

This commit is contained in:
Ken-Håvard Lieng 2017-05-29 03:02:39 +02:00
parent a084e6d0af
commit fa9c5a9c16
4 changed files with 42 additions and 45 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,24 +1,29 @@
import React from 'react';
import React, { Component } from 'react';
import Route from '../containers/Route';
import Chat from '../containers/Chat';
import Connect from '../containers/Connect';
import Settings from '../containers/Settings';
import TabList from '../components/TabList';
const App = props => {
const { onClick, ...tabListProps } = props;
const mainClass = props.showTabList ? 'main-container off-canvas' : 'main-container';
export default class App extends Component {
handleClick = () => {
const { showTabList, hideMenu } = this.props;
if (showTabList) {
hideMenu();
}
};
return (
<div onClick={onClick}>
<TabList {...tabListProps} />
<div className={mainClass}>
<Route name="chat"><Chat /></Route>
<Route name="connect"><Connect /></Route>
<Route name="settings"><Settings /></Route>
render() {
const mainClass = this.props.showTabList ? 'main-container off-canvas' : 'main-container';
return (
<div onClick={this.handleClick}>
<TabList {...this.props} />
<div className={mainClass}>
<Route name="chat"><Chat /></Route>
<Route name="connect"><Connect /></Route>
<Route name="settings"><Settings /></Route>
</div>
</div>
</div>
);
};
export default App;
);
}
}

View File

@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import { List } from 'immutable';
import Navicon from '../components/Navicon';
import Navicon from '../containers/Navicon';
import { linkify } from '../util';
export default class ChatTitle extends PureComponent {

View File

@ -1,4 +1,3 @@
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import App from '../components/App';
@ -17,13 +16,6 @@ const mapState = createStructuredSelector({
tab: getSelectedTab
});
const mapDispatch = (dispatch, props) => ({
onClick: () => {
if (props.showTabList) {
dispatch(hideMenu());
}
},
...bindActionCreators({ push, select }, dispatch)
});
const mapDispatch = { push, select, hideMenu };
export default connect(mapState, mapDispatch)(App);