lbry-desktop/ui/component/fileTitleSection/index.js

29 lines
777 B
JavaScript
Raw Normal View History

2021-03-11 18:08:11 +01:00
import { connect } from 'react-redux';
import { doFetchSubCount, selectSubCountForUri } from 'lbryinc';
import { selectClaimForUri } from 'redux/selectors/claims';
2021-03-11 18:08:11 +01:00
import FileTitleSection from './view';
import { getClaimTitle } from 'util/claim';
2021-03-11 18:08:11 +01:00
2021-06-17 20:55:23 +02:00
const select = (state, props) => {
const { uri } = props;
const claim = selectClaimForUri(state, uri);
const { signing_channel: channel } = claim || {};
const channelUri = channel && channel.canonical_url;
const channelClaimId = channel && channel.claim_id;
const title = getClaimTitle(claim);
2021-06-17 20:55:23 +02:00
return {
subCount: channelUri && selectSubCountForUri(state, channelUri),
channelClaimId,
title,
2021-06-17 20:55:23 +02:00
};
};
2021-03-11 18:08:11 +01:00
const perform = {
doFetchSubCount,
};
export default connect(select, perform)(FileTitleSection);