2017-05-07 20:19:15 +00:00
|
|
|
import { createStructuredSelector } from 'reselect';
|
2018-11-09 07:11:01 +00:00
|
|
|
import connect from 'utils/connect';
|
2017-05-07 20:19:15 +00:00
|
|
|
|
2017-05-19 05:28:08 +00:00
|
|
|
const Route = ({ route, name, children }) => {
|
|
|
|
if (route === name) {
|
|
|
|
return children;
|
2017-05-07 20:19:15 +00:00
|
|
|
}
|
2017-05-19 05:28:08 +00:00
|
|
|
return null;
|
|
|
|
};
|
2017-05-07 20:19:15 +00:00
|
|
|
|
|
|
|
const getRoute = state => state.router.route;
|
|
|
|
|
2017-05-26 06:20:00 +00:00
|
|
|
const mapState = createStructuredSelector({
|
2017-05-07 20:19:15 +00:00
|
|
|
route: getRoute
|
|
|
|
});
|
|
|
|
|
2017-05-26 06:20:00 +00:00
|
|
|
export default connect(mapState)(Route);
|