lbry-desktop/ui/component/fileTitleSection/index.js
Rafael bc68207f40 Refactor fileTitleSection
- selectInsufficientCreditsForUri unused
- used util function instead of redux selector for title
- only pass needed claim props
2022-02-08 12:35:40 -05:00

28 lines
777 B
JavaScript

import { connect } from 'react-redux';
import { doFetchSubCount, selectSubCountForUri } from 'lbryinc';
import { selectClaimForUri } from 'redux/selectors/claims';
import FileTitleSection from './view';
import { getClaimTitle } from 'util/claim';
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);
return {
subCount: channelUri && selectSubCountForUri(state, channelUri),
channelClaimId,
title,
};
};
const perform = {
doFetchSubCount,
};
export default connect(select, perform)(FileTitleSection);