ea9c7a4a27
* Refactor CommentBadge * Refactor livestreamComment component * Refactor and split livestreamComment CSS * Refactor livestreamComments component * Refactor and split livestreamComments CSS * Remove never used spinner * Refactor livestream Page * Refactor page component * Refactor livestreamLayout component * Break apart livestreamComments into separate sibling components - This helps separating LivestreamComments to deal with only the comments, and the LivestreamLayout to be used for its own Page as a Popout option, and also for a layered approach for mobile * Create Popout Chat Page, Add Popout Chat Menu Option * Add Hide Chat option * sockety improvements * Websocket changes Co-authored-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
34 lines
1.4 KiB
JavaScript
34 lines
1.4 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { makeSelectTagInClaimOrChannelForUri, selectClaimForUri } from 'redux/selectors/claims';
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
|
import { doUserSetReferrer } from 'redux/actions/user';
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
|
import { doCommentSocketConnect, doCommentSocketDisconnect } from 'redux/actions/websocket';
|
|
import { getChannelIdFromClaim } from 'util/claim';
|
|
import { selectActiveLivestreamForChannel, selectActiveLivestreamInitialized } from 'redux/selectors/livestream';
|
|
import { doFetchChannelLiveStatus } from 'redux/actions/livestream';
|
|
import LivestreamPage from './view';
|
|
|
|
const select = (state, props) => {
|
|
const { uri } = props;
|
|
const channelClaimId = getChannelIdFromClaim(selectClaimForUri(state, uri));
|
|
|
|
return {
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
|
channelClaimId,
|
|
chatDisabled: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_COMMENTS_TAG)(state),
|
|
activeLivestreamForChannel: selectActiveLivestreamForChannel(state, channelClaimId),
|
|
activeLivestreamInitialized: selectActiveLivestreamInitialized(state),
|
|
};
|
|
};
|
|
|
|
const perform = {
|
|
doSetPlayingUri,
|
|
doUserSetReferrer,
|
|
doCommentSocketConnect,
|
|
doCommentSocketDisconnect,
|
|
doFetchChannelLiveStatus,
|
|
};
|
|
|
|
export default connect(select, perform)(LivestreamPage);
|