Move wrapWidth handling out of MessageBox, improve scroll position handling, use custom routing, close menu when clicking anywhere
This commit is contained in:
parent
a753efd1dd
commit
fec7c93abc
24 changed files with 363 additions and 235 deletions
20
client/src/js/containers/Route.js
Normal file
20
client/src/js/containers/Route.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { PureComponent } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createStructuredSelector } from 'reselect';
|
||||
|
||||
class Route extends PureComponent {
|
||||
render() {
|
||||
if (this.props.route === this.props.name) {
|
||||
return this.props.children;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const getRoute = state => state.router.route;
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
route: getRoute
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(Route);
|
Loading…
Add table
Add a link
Reference in a new issue