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 Route from '../containers/Route';
|
||||||
import Chat from '../containers/Chat';
|
import Chat from '../containers/Chat';
|
||||||
import Connect from '../containers/Connect';
|
import Connect from '../containers/Connect';
|
||||||
import Settings from '../containers/Settings';
|
import Settings from '../containers/Settings';
|
||||||
import TabList from '../components/TabList';
|
import TabList from '../components/TabList';
|
||||||
|
|
||||||
const App = props => {
|
export default class App extends Component {
|
||||||
const { onClick, ...tabListProps } = props;
|
handleClick = () => {
|
||||||
const mainClass = props.showTabList ? 'main-container off-canvas' : 'main-container';
|
const { showTabList, hideMenu } = this.props;
|
||||||
|
if (showTabList) {
|
||||||
|
hideMenu();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
render() {
|
||||||
<div onClick={onClick}>
|
const mainClass = this.props.showTabList ? 'main-container off-canvas' : 'main-container';
|
||||||
<TabList {...tabListProps} />
|
return (
|
||||||
<div className={mainClass}>
|
<div onClick={this.handleClick}>
|
||||||
<Route name="chat"><Chat /></Route>
|
<TabList {...this.props} />
|
||||||
<Route name="connect"><Connect /></Route>
|
<div className={mainClass}>
|
||||||
<Route name="settings"><Settings /></Route>
|
<Route name="chat"><Chat /></Route>
|
||||||
|
<Route name="connect"><Connect /></Route>
|
||||||
|
<Route name="settings"><Settings /></Route>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
);
|
||||||
);
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
export default App;
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import { List } from 'immutable';
|
import { List } from 'immutable';
|
||||||
import Navicon from '../components/Navicon';
|
import Navicon from '../containers/Navicon';
|
||||||
import { linkify } from '../util';
|
import { linkify } from '../util';
|
||||||
|
|
||||||
export default class ChatTitle extends PureComponent {
|
export default class ChatTitle extends PureComponent {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { bindActionCreators } from 'redux';
|
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { createStructuredSelector } from 'reselect';
|
import { createStructuredSelector } from 'reselect';
|
||||||
import App from '../components/App';
|
import App from '../components/App';
|
||||||
@ -17,13 +16,6 @@ const mapState = createStructuredSelector({
|
|||||||
tab: getSelectedTab
|
tab: getSelectedTab
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatch = (dispatch, props) => ({
|
const mapDispatch = { push, select, hideMenu };
|
||||||
onClick: () => {
|
|
||||||
if (props.showTabList) {
|
|
||||||
dispatch(hideMenu());
|
|
||||||
}
|
|
||||||
},
|
|
||||||
...bindActionCreators({ push, select }, dispatch)
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapState, mapDispatch)(App);
|
export default connect(mapState, mapDispatch)(App);
|
||||||
|
Loading…
Reference in New Issue
Block a user