Fix navicon
This commit is contained in:
parent
a084e6d0af
commit
fa9c5a9c16
File diff suppressed because one or more lines are too long
@ -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;
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user