2015-12-28 23:34:32 +00:00
|
|
|
import { connect } from 'react-redux';
|
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';
|
|
|
|
import { getSortedPrivateChats } 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';
|
|
|
|
import { push } from 'util/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,
|
2017-06-29 04:56:05 +00:00
|
|
|
privateChats: getSortedPrivateChats,
|
2017-05-26 06:20:00 +00:00
|
|
|
servers: getServers,
|
|
|
|
showTabList: getShowTabList,
|
|
|
|
tab: getSelectedTab
|
|
|
|
});
|
2015-12-28 23:34:32 +00:00
|
|
|
|
2017-05-29 01:02:39 +00:00
|
|
|
const mapDispatch = { push, select, hideMenu };
|
2017-05-27 05:30:22 +00:00
|
|
|
|
|
|
|
export default connect(mapState, mapDispatch)(App);
|