dispatch/client/js/containers/App.js

28 lines
845 B
JavaScript
Raw Normal View History

import { createStructuredSelector } from 'reselect';
import App from 'components/App';
import { getConnected } from 'state/app';
2017-06-29 04:56:05 +00:00
import { getSortedChannels } from 'state/channels';
2018-04-25 03:36:27 +00:00
import { getPrivateChats } from 'state/privateChats';
import { getServers } from 'state/servers';
import { getSelectedTab, select } from 'state/tab';
import { getShowTabList, hideMenu } from 'state/ui';
import connect from 'utils/connect';
import { push } from 'utils/router';
2015-12-28 23:34:32 +00:00
const mapState = createStructuredSelector({
2017-06-29 04:56:05 +00:00
channels: getSortedChannels,
2017-06-06 23:03:35 +00:00
connected: getConnected,
2018-04-25 03:36:27 +00:00
privateChats: getPrivateChats,
servers: getServers,
showTabList: getShowTabList,
2018-11-06 10:13:32 +00:00
tab: getSelectedTab,
newVersionAvailable: state => state.app.newVersionAvailable
});
2015-12-28 23:34:32 +00:00
2017-05-29 01:02:39 +00:00
const mapDispatch = { push, select, hideMenu };
2018-05-28 01:16:05 +00:00
export default connect(
mapState,
mapDispatch
)(App);