2017-05-26 06:20:00 +00:00
|
|
|
import { createStructuredSelector } from 'reselect';
|
2017-06-21 06:40:28 +00:00
|
|
|
import App from 'components/App';
|
|
|
|
import { getConnected } from 'state/app';
|
2017-06-29 04:56:05 +00:00
|
|
|
import { getSortedChannels } from 'state/channels';
|
2019-01-23 06:34:39 +00:00
|
|
|
import { openModal, getHasOpenModals } from 'state/modals';
|
2018-04-25 03:36:27 +00:00
|
|
|
import { getPrivateChats } from 'state/privateChats';
|
2017-06-21 06:40:28 +00:00
|
|
|
import { getServers } from 'state/servers';
|
|
|
|
import { getSelectedTab, select } from 'state/tab';
|
|
|
|
import { getShowTabList, hideMenu } from 'state/ui';
|
2018-11-09 07:11:01 +00:00
|
|
|
import connect from 'utils/connect';
|
2018-04-05 19:13:32 +00:00
|
|
|
import { push } from 'utils/router';
|
2015-12-28 23:34:32 +00:00
|
|
|
|
2017-05-26 06:20:00 +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,
|
2017-05-26 06:20:00 +00:00
|
|
|
servers: getServers,
|
|
|
|
showTabList: getShowTabList,
|
2018-11-06 10:13:32 +00:00
|
|
|
tab: getSelectedTab,
|
2019-01-05 06:08:34 +00:00
|
|
|
newVersionAvailable: state => state.app.newVersionAvailable,
|
|
|
|
hasOpenModals: getHasOpenModals
|
2017-05-26 06:20:00 +00:00
|
|
|
});
|
2015-12-28 23:34:32 +00:00
|
|
|
|
2019-01-23 06:34:39 +00:00
|
|
|
const mapDispatch = { push, select, hideMenu, openModal };
|
2017-05-27 05:30:22 +00:00
|
|
|
|
2020-04-30 05:54:30 +00:00
|
|
|
export default connect(mapState, mapDispatch)(App);
|