2021-03-10 13:34:21 -05:00
|
|
|
import { connect } from 'react-redux';
|
2022-01-14 17:24:16 -03:00
|
|
|
import { selectClaimForUri, makeSelectTagInClaimOrChannelForUri, selectThumbnailForUri } from 'redux/selectors/claims';
|
2022-02-02 09:45:16 -03:00
|
|
|
import { selectSuperChatsForUri } from 'redux/selectors/comments';
|
2021-03-10 13:34:21 -05:00
|
|
|
import LivestreamLayout from './view';
|
2021-06-03 11:55:16 -04:00
|
|
|
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
2022-02-07 10:04:25 -03:00
|
|
|
import { selectViewersForId } from 'redux/selectors/livestream';
|
2021-03-10 13:34:21 -05:00
|
|
|
|
2022-01-14 17:24:16 -03:00
|
|
|
const select = (state, props) => {
|
|
|
|
const { uri } = props;
|
|
|
|
|
2022-02-07 10:04:25 -03:00
|
|
|
const claim = selectClaimForUri(state, uri);
|
|
|
|
const claimId = claim && claim.claim_id;
|
|
|
|
|
2022-01-14 17:24:16 -03:00
|
|
|
return {
|
2022-02-07 10:04:25 -03:00
|
|
|
claim,
|
2022-01-14 17:24:16 -03:00
|
|
|
thumbnail: selectThumbnailForUri(state, uri),
|
|
|
|
chatDisabled: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_COMMENTS_TAG)(state),
|
2022-02-02 09:45:16 -03:00
|
|
|
superChats: selectSuperChatsForUri(state, uri),
|
2022-02-07 10:04:25 -03:00
|
|
|
activeViewers: claimId && selectViewersForId(state, claimId),
|
2022-01-14 17:24:16 -03:00
|
|
|
};
|
|
|
|
};
|
2021-03-10 13:34:21 -05:00
|
|
|
|
|
|
|
export default connect(select)(LivestreamLayout);
|