dispatch/client/js/containers/App.js

27 lines
945 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';
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';
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,
hasOpenModals: getHasOpenModals
});
2015-12-28 23:34:32 +00:00
2019-01-23 06:34:39 +00:00
const mapDispatch = { push, select, hideMenu, openModal };
2020-04-30 05:54:30 +00:00
export default connect(mapState, mapDispatch)(App);